mirror of
https://github.com/austinried/subtracks.git
synced 2025-12-27 00:59:28 +01:00
improve url validation in settings
This commit is contained in:
parent
1c76293559
commit
52b51954aa
@ -45,10 +45,10 @@ class SourcePage extends HookConsumerWidget {
|
||||
autofillHints: const [AutofillHints.url],
|
||||
required: true,
|
||||
validator: (value, label) {
|
||||
if (Uri.tryParse(value!) == null) {
|
||||
if (Uri.tryParse(value!)?.isAbsolute == false ||
|
||||
!value.contains('http')) {
|
||||
return '$label must be a valid URL';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
);
|
||||
final username = LabeledTextField(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user