Andrea Bizzotto
Oct 12, 2018 · 2 min read

Today I’m launching a new video about Input Validation and RegExp.

As part of this, I’ll give you an overview of regular expressions (regex) and how they works by using a live web regex validator.

Then we will see how to implement a Regex validator in Dart and integrate it with Flutter’s TextField widget, so that we can validate user input.

I will use a demo app to illustrate two sample use cases:

  • Make a payment (numeric validator with 2 decimal digits, 4 non-decimal digits)
  • Forgot password (email input validation)

Highlights

  • What is Regex and how to use it.
  • Implementing a Regex validator in Dart.
  • How to configure TextField to validate text input and provide hints for the user.
  • Email and number input validation via Regex.
  • Putting it together: building a configurable input validation page.

Relevant classes: RegExp, TextField, TextInputFormatter, InputDecoration, FocusNode​.

Full source code is available here:

My previous articles about BottomAppBar navigation with FAB:

Happy coding!

UPDATE: My Flutter & Firebase Udemy course is now available for Early Access. Use this link to enroll (discount code included):

For more articles and video tutorials, check out Coding With Flutter.

I’m @biz84 on Twitter. You can also see my GitHub page. Did you like this article? Then smash that clap 👏 button! It makes me feel awesome so I can write more about Flutter. 😎

Coding with Flutter

Learn to build iOS and Android apps with Dart and Flutter

Andrea Bizzotto

Written by

iOS, Flutter Developer & Blogger ❖ https://codingwithflutter.com ❖ http://bizz84.github.io ❖ Open Source https://github.com/bizz84 ❖ Watching #ClimateChange

Coding with Flutter

Learn to build iOS and Android apps with Dart and Flutter

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade