form_builder_validators
11.3.0, released 10 months ago by flutterformbuilderecosystem.com
A comprehensive collection of ready-made FormField validators for Flutter.
What it does
Provides standard validation rules (like required, email, numeric, credit card, etc.) for any FormField widget. It allows combining multiple validation rules, transforming values, and localizing error messages into numerous languages.
AI-written summary of version 11.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need pre-built validators for common input types like email, URLs, numbers, and custom regex.
- You need to internationalize form error messages into multiple languages.
- You want to compose or chain multiple validation rules together declaratively.
Skip it when
- You are using a state-management form library that already has its own robust validation mechanism like formz and prefer keeping validation tied directly to that model.
Strengths
- Extensive library of pre-built validators covering core, network, numeric, finance, string, and identity use cases.
- Built-in localization support for dozens of languages.
- Supports composing, conditional validation, and chaining validators.
Weaknesses
- Requires maintaining additional dependencies if used for very basic forms where standard Flutter validator callbacks suffice.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
Requires adding flutter_localizations to your app configuration for localized error messages.
TextFormField(
decoration: const InputDecoration(labelText: 'Email'),
validator: FormBuilderValidators.compose([
FormBuilderValidators.required(),
FormBuilderValidators.email(),
]),
)Alternatives
Packages that do the same job and could replace form_builder_validators.
- formz
Choose formz if you prefer a standalone, immutable input validation approach for BLoC or other state management solutions without relying on Flutter's FormField widgets.
90Compare - string_validator
Choose string_validator if you only need lightweight string checking functions rather than a full FormField validation suite.
64Compare
Works with
Packages commonly used together with form_builder_validators: ones it builds on, ones built on it, and its own family.
- intlform_builder_validators depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- flutter_form_builderSame familyHelps create forms in Flutter by removing boilerplate code and reusing validation.
- form_builder_extra_fieldsSame familyAdditional ready-made form input fields for the flutter_form_builder package
- form_builder_phone_fieldSame familyInternational phone number input field for the flutter_form_builder package.
- form_builder_image_pickerSame familyFormBuilder field widget to pick images from gallery or camera.
- form_builder_file_pickerSame familyFile picker input field for the flutter_form_builder package.