isStrongPassword property

bool get isStrongPassword

Returns true if string match strong password requirements

Implementation

bool get isStrongPassword {
  final requirements = [
    RegExp(r'.{8,}'), // 8+ chars
    RegExp(r'(?=.*[a-z])'), // lowercase
    RegExp(r'(?=.*[A-Z])'), // uppercase
    RegExp(r'(?=.*\d)'), // digit
    RegExp(r'(?=.*[@$!%*?&])') // special
  ];
  return this != null && requirements.every((regex) => regex.hasMatch(this!));
}