return null

This commit is contained in:
Joel Calado 2023-05-14 13:27:33 +01:00 committed by austinried
parent 52b51954aa
commit 889be2ff2c

View File

@ -45,10 +45,10 @@ class SourcePage extends HookConsumerWidget {
autofillHints: const [AutofillHints.url], autofillHints: const [AutofillHints.url],
required: true, required: true,
validator: (value, label) { validator: (value, label) {
if (Uri.tryParse(value!)?.isAbsolute == false || if (!value!.contains(RegExp(r'https?:\/\/'))) {
!value.contains('http')) {
return '$label must be a valid URL'; return '$label must be a valid URL';
} }
return null;
}, },
); );
final username = LabeledTextField( final username = LabeledTextField(