validateOldPassword method
Implementation
String? validateOldPassword(String value) {
if (kDebugMode) {
print("validatepassword : $value ");
}
if (value.isEmpty) return "Enter your old password";
if (!RegExp(r"^(?=.*[A-Za-z])(?=.*\d).{6,}$").hasMatch(value)) {
return 'Password Should be Alphanumeric';
}
if (value.length <= 6) {
return "Password Should be more than 6 character";
}
// Pattern pattern =
// r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[!@#\$&*~]).{6,}$';
// RegExp regex = RegExp(pattern);
// if (!regex.hasMatch(value.trim())) {
// return "include one capital letter, number and symbol";
// }
return null;
}