Flutter: Input Validation with RegExp

This video is about Input Validation and RegExp.

As part of this, I'll give you an overview of regular expressions (regex) and how they work 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)

Included

  • Demo app preview
  • Regex web examples
  • Regex in Flutter
  • Input Validation Page & TextField
  • TextInputFormatter
  • Email validation
  • Editing / submitting text
  • InputValidationPage implementation
  • keeping focus on the keyboard
  • Wrap up

Notes:

  • I'm using the iOS simulator, but you can open the Android emulator and run the same code.
  • This code was tested with Flutter Beta 0.8.2.

Thanks for watching!

Want More?

Invest in yourself with my high-quality Flutter courses.

The Complete Dart Developer Guide

The Complete Dart Developer Guide

Learn Dart Programming in depth. Includes: basic to advanced topics, exercises, and projects. Fully updated to Dart 2.15.

Flutter Animations Masterclass - Full Course

Flutter Animations Masterclass - Full Course

Master Flutter animations and build a completely custom habit tracking application.

Flutter & Firebase Course: Build a Complete App for iOS & Android

Flutter & Firebase Course: Build a Complete App for iOS & Android

A full course with in-depth content, taking you from the basics all the way up to more advanced topics.

Flutter REST API Crash Course

Flutter REST API Crash Course

Build a Coronavirus Tracking App, and learn how to use REST APIs in Flutter.

Get the best Flutter tutorials, right in your inbox.

Join over 16,000 developers who receive my weekly Flutter email course & newsletter:

No spam, ever. Unsubscribe at any time.