0

Are there no built in validators for common use cases such as emails, phone numbers, etc. in the Flutter framework?

The web is littered with examples of people implementing their own email validating functions in Dart, but I'm surprised that there doesn't seem to be any built in ones in Flutter, like a FormFieldValidator.email, etc. Or did I just not find it?

Magnus
  • 17,157
  • 19
  • 104
  • 189
  • 1
    If you can't find something already built in have a search through pub.dev - https://pub.dev/packages/flutter_form_builder – F-1 Jul 26 '19 at 08:10

1 Answers1

0

If you find that some sort of functionality is missing from Flutter out of the box, chances are that someone has created a package for Flutter (or you can). Just check the pub.dev website and filter by Flutter.

I've had a look and there is a package called 'flutter_form_builder' https://pub.dev/packages/flutter_form_builder

This package helps in generation of forms in Flutter by providing the syntactic sugar for creating a Form Widget and reduce the boilerplate needed to build a form, validate fields, react to changes, and collect the value of the Form in the form of a map.

....

  • FormBuilderTextField - For text input. Allows input of single-line text, multi-line text, password, email, urls etc by using different configurations and validators
Community
  • 1
  • 1
F-1
  • 2,887
  • 20
  • 28