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?

1

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.