required<T> static method

FormFieldValidator<T> required<T>({
  1. String? errorText,
  2. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field have a non-empty value.

Parameters:

  • errorText The error message when the value is empty.
  • checkNullOrEmpty Whether to check for null or empty values.

Implementation

static FormFieldValidator<T> required<T>({
  String? errorText,
  bool checkNullOrEmpty = true,
}) => RequiredValidator<T>(
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;