You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -442,19 +442,19 @@ max, minLength, maxLength, IP, credit card etc. with default `errorText` in Engl
442
442
ability to include you own error message that will display whenever validation fails.
443
443
444
444
Available built-in validators include:
445
-
*`FormBuilderValidators.required()` - requires the field have a non-empty value.
446
-
*`FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
447
-
*`FormBuilderValidators.min()` - requires the field's value to be greater than or equal to the provided number.
445
+
*`FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
446
+
*`FormBuilderValidators.date()` - requires the field's value to be a valid date string.
447
+
*`FormBuilderValidators.email()` - requires the field's value to be a valid email address.
448
+
*`FormBuilderValidators.equal()` - requires the field's value be equal to provided object.
449
+
*`FormBuilderValidators.IP()` - requires the field's value to be a valid IP address.
450
+
*`FormBuilderValidators.match()` - requires the field's value to match the provided regex pattern.
448
451
*`FormBuilderValidators.max()` - requires the field's value to be less than or equal to the provided number.
449
-
*`FormBuilderValidators.minLength()` - requires the length of the field's value to be greater than or equal to the provided minimum length.
450
452
*`FormBuilderValidators.maxLength()` - requires the length of the field's value to be less than or equal to the provided maximum length.
451
-
*`FormBuilderValidators.pattern()` - requires the field's value to match the provided regex pattern.
452
-
*`FormBuilderValidators.email()` - requires the field's value to be a valid email address.
453
+
*`FormBuilderValidators.min()` - requires the field's value to be greater than or equal to the provided number.
454
+
*`FormBuilderValidators.minLength()` - requires the length of the field's value to be greater than or equal to the provided minimum length.
455
+
*`FormBuilderValidators.numeric()` - requires the field's value to be a valid number.
456
+
*`FormBuilderValidators.required()` - requires the field have a non-empty value.
453
457
*``FormBuilderValidators.url()`` - requires the field's value to be a valid url.
454
-
*`FormBuilderValidators.IP()` - requires the field's value to be a valid IP address.
455
-
*`FormBuilderValidators.creditCard()` - requires the field's value to be a valid credit card number.
456
-
*`FormBuilderValidators.date()` - requires the field's value to be a valid date string.
457
-
*`FormBuilderValidators.requiredTrue()` - requires the field's value be true.
458
458
459
459
### Using multiple validators
460
460
`FormBuilderValidators` class comes with a very useful static function named `compose()` which takes in any number of `FormFieldValidator` functions. On validation each validator is run and if any returns a non-null value (i.e. a String), validation fails and the `errorText` for the field is set as the returned string.
Copy file name to clipboardExpand all lines: pubspec.yaml
+2-6Lines changed: 2 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
name: flutter_form_builder
2
2
description: Package to build Material Form with fields like TextField, DropDown, Switches etc. with ability to create custom FormFields and composability and reuse validation functions.
0 commit comments