password method

String? Function(String?) password({
  1. int minLength = 6,
  2. String? requiredMsg,
  3. String? shortMsg,
})

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;
  };
}