From the course: Flutter Essential Training: Build for Multiple Platforms
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Validating user inputs - Flutter Tutorial
From the course: Flutter Essential Training: Build for Multiple Platforms
Validating user inputs
- [Instructor] Building a text field was definitely easy in Flutter. However, our work is not done yet. What if the user is typing some faulty inputs? Like you have a field that takes an email ID, then you must verify that the input has an at character like @gmail.com, or the username or password is less than five characters which your system does not allow maybe. Now in such cases, you want to throw an error. So suppose you have a validation logic in your login user function right here. So you check that username.controller.text.length because you want to check if the length is less than five characters. Then we throw some errors. You can do the exact same thing for password here. Just make this password controller. Now, if there are more validation checks you need to add, the permutation and combination of this if, else checks will be a lot and there will be duplicated errors popping up on the screen. What we want…
Contents
-
-
-
-
-
-
What is state?1m 55s
-
(Locked)
Writing your first stateful widget7m 17s
-
(Locked)
Widget variables vs. state variables3m 26s
-
(Locked)
When to use stateless or stateful?1m 51s
-
(Locked)
Lifecycle of a stateful widget3m 44s
-
(Locked)
Stateful hot reload3m 22s
-
(Locked)
Learning about buttons6m 50s
-
(Locked)
Taps and gesture detection3m 47s
-
(Locked)
Getting inputs from the user7m 40s
-
(Locked)
Validating user inputs7m 55s
-
(Locked)
Creating multiline text fields6m 46s
-
(Locked)
Navigating from one screen to another5m 41s
-
(Locked)
Passing data with navigation2m 7s
-
(Locked)
Navigating via named routes4m 8s
-
(Locked)
Replacing routes using Navigator5m 16s
-
-
-
-
-