Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
Updated 28 April 2023
In this blog, We will design a simple login page, with e-mail and password validation. We will get the final result like the attached image.
Before we start, if you like check our Flutter app development company page.
Step 1:
We make an app entry main class. In this class, we have to define app routes.
How is form input field validation handled in flutter?
Flutter has validation API, you need to use Form with TextFormField.
Form: Form is a container for FormFields (and its descendants) and other widgets. We also have saved, validate, and reset functions. These facilitate easier validation and manipulation of data inputted in one or multiple FormFields.
Properties GlobalKey: We pass GlobalKey<FormState> _key in Form as the attribute to access form state to save, validate, and reset.
Autovalidate: We pass bool _validate in Form If true, form fields will validate and update their error text immediately after every change. Otherwise, you must call FormState.validate to validate.
TextFormField: A FormField that contains a TextField. This is a convenience widget that wraps a TextField widget in a FormField.
You need to create a data model class for storing input login input data.
We created a separate helper class for validating Form field data. In FormValidator class, we have defined methods to validate passwords and email Id.
I hope this blog will help to make the Login page.
Happy Learning 🙂
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Name
Email
Subject
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.