minLength static method

FormFieldValidator<String> minLength({
  1. required int minLength,
  2. required String message,
})

Fails when shorter than minLength. UValidators.minLength(minLength: 8, message: "Too short")

Implementation

static FormFieldValidator<String> minLength({required int minLength, required String message}) => (String? value) {
  if (value == null || value.length < minLength) return message;
  return null;
};