Skip to content

Commit 46ff505

Browse files
feat: Improve url validator documentation
1 parent 8ed7f59 commit 46ff505

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/src/form_builder_validators.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,14 @@ class FormBuilderValidators {
182182
: null;
183183

184184
/// [FormFieldValidator] that requires the field's value to be a valid url.
185+
///
186+
/// * [protocols] sets the list of allowed protocols. By default `['http', 'https', 'ftp']`
187+
/// * [requireTld] sets if TLD is required. By default `true`
188+
/// * [requireProtocol] is a `bool` that sets if protocol is required for validation
189+
/// By default `false`
190+
/// * [allowUnderscore] sets if underscores are allowed. By default `false`
191+
/// * [hostWhitelist] sets the list of allowed hosts
192+
/// * [hostBlacklist] sets the list of disallowed hosts
185193
static FormFieldValidator<String> url({
186194
String? errorText,
187195
List<String> protocols = const ['http', 'https', 'ftp'],

0 commit comments

Comments
 (0)