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);
}
}