Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

validator in form field flutter

1
2
3
4
5
6
7
8
9
10
mixin InputValidationMixin {
  bool isPasswordValid(String password) => password.length == 6;

  bool isEmailValid(String email) {
    Pattern pattern =
      r '^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$';
    RegExp regex = new RegExp(pattern);
    return regex.hasMatch(email);
  }
}
Source by www.topcoder.com #
 
PREVIOUS NEXT
Tagged: #validator #form #field #flutter
ADD COMMENT
Topic
Name
5+6 =