validatePassword static method
Implementation
static String? validatePassword(String? value) {
if (value == null || value.isEmpty) {
return 'Password is required';
} else if (value.length < 6) {
return 'Password must be at least 6 characters';
} else if (value.length > 20) {
return 'Password must not exceed 20 characters';
}
return null;
}