I want to perform multiple validations in TextFormField in flutter like field required validation, only alphabets validations or only numbers validation etc at the same time. Please suggest any idea. Thanks in advance.
Package https://pub.dev/packages/flutter_form_builder support build in validators
https://pub.dev/packages/flutter_form_builder#built-in-validators
such as 
FormBuilderValidators.required() - requires the field have a non-empty value. 
FormBuilderValidators.numeric() - requires the field's value to be a valid number. 
you can put two or more validate in validators attributes, 
code snippet
FormBuilderTextField(
  attribute: "age",
  decoration: InputDecoration(labelText: "Age"),
  validators: [
    FormBuilderValidators.numeric(errorText: "La edad debe ser numérica."),
    FormBuilderValidators.max(70),
  ],
),
example code https://github.com/danvick/flutter_form_builder/blob/master/example/lib/main.dart
working demo

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With