isTrue static method

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

FormFieldValidator that requires the field's value to be a bool and true.

Parameters:

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

Implementation

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