Created
February 28, 2018 21:43
-
-
Save anilcancakir/a24016cdc79b8afb7587e46444065793 to your computer and use it in GitHub Desktop.
Forms in Flutter - Code #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:validate/validate.dart'; // Add import for validate package. | |
| class _LoginPageState extends State<LoginPage> { | |
| // Add validate email function. | |
| String _validateEmail(String value) { | |
| if (!Validate.isEmail(value)) { | |
| return 'The E-mail Address must be a valid email address.'; | |
| } | |
| return null; | |
| } | |
| // Add validate password function. | |
| String _validatePassword(String value) { | |
| if (value.length < 8) { | |
| return 'The Password must be at least 8 characters.'; | |
| } | |
| return null; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment