password method

String? password(
  1. String value
)

Implementation

String?  password(String value) {
  if (kDebugMode) {
    print("validatepassword : $value ");
  }

  if (value.isEmpty) return "Enter your   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;
}