timeZone static method

FormFieldValidator<String> timeZone({
  1. List<String>? validTimeZones,
  2. String? errorText,
  3. bool checkNullOrEmpty = true,
})

FormFieldValidator that requires the field's value to be a valid time zone.

Parameters:

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

Implementation

/// ## Parameters:
/// - [errorText] The error message when the time zone is invalid.
/// - [checkNullOrEmpty] Whether to check for null or empty values.
/// {@macro time_zone_template}
static FormFieldValidator<String> timeZone({
  List<String>? validTimeZones,
  String? errorText,
  bool checkNullOrEmpty = true,
}) => TimeZoneValidator(
  validTimeZones: validTimeZones,
  errorText: errorText,
  checkNullOrEmpty: checkNullOrEmpty,
).validate;