TextValidationConfig.required constructor

TextValidationConfig.required({
  1. int? minLength,
  2. int? maxLength,
  3. String? pattern,
  4. String? allowedCharacters,
  5. Set<String> blacklistedWords = const {},
  6. bool trimWhitespace = true,
})

Preset for required text input.

Implementation

factory TextValidationConfig.required({
  int? minLength,
  int? maxLength,
  String? pattern,
  String? allowedCharacters,
  Set<String> blacklistedWords = const {},
  bool trimWhitespace = true,
}) {
  return TextValidationConfig(
    allowEmpty: false,
    allowOnlyWhitespace: false,
    trimWhitespace: trimWhitespace,
    minLength: minLength,
    maxLength: maxLength,
    pattern: pattern,
    allowedCharacters: allowedCharacters,
    blacklistedWords: blacklistedWords,
  );
}