password method
Implementation
String? Function(String?) password({
int minLength = 6,
String? requiredMsg,
String? shortMsg,
}) {
return (value) {
if (value == null || value.trim().isEmpty) {
return requiredMsg ?? messages.required;
}
if (value.length < minLength) {
return shortMsg ?? messages.passwordMinLength(minLength);
}
return null;
};
}