put regex to private variable
This commit is contained in:
parent
e91e5789ee
commit
33ff99510f
|
@ -151,9 +151,11 @@ class AddLinkDialog extends HookWidget {
|
||||||
final String url;
|
final String url;
|
||||||
final String selection;
|
final String selection;
|
||||||
|
|
||||||
|
static final _websiteRegex = RegExp(r'https?:\/\/', caseSensitive: false);
|
||||||
|
|
||||||
AddLinkDialog(this.selection)
|
AddLinkDialog(this.selection)
|
||||||
: title = selection.startsWith('https?://') ? '' : selection,
|
: title = selection.startsWith(_websiteRegex) ? '' : selection,
|
||||||
url = selection.startsWith('https?://') ? selection : '';
|
url = selection.startsWith(_websiteRegex) ? selection : '';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
Loading…
Reference in New Issue