notEmpty static method

FormFieldValidator<List> notEmpty([
  1. String? message
])

Implementation

static FormFieldValidator<List> notEmpty([String? message]) {
  return (List? value) {
    if (value == null || value.isEmpty) {
      return message ?? 'This field is required';
    }

    return null;
  };
}