TextValidationConfig constructor

const TextValidationConfig({
  1. int? minLength,
  2. int? maxLength,
  3. bool allowEmpty = false,
  4. bool allowOnlyWhitespace = false,
  5. bool trimWhitespace = true,
  6. String? pattern,
  7. Set<String> blacklistedWords = const {},
  8. String? allowedCharacters,
  9. bool wholeWordBlacklist = false,
})

Creates a new TextValidationConfig with customizable rules.

By default, trims whitespace and does not allow empty text.

Implementation

const TextValidationConfig({
  this.minLength,
  this.maxLength,
  this.allowEmpty = false,
  this.allowOnlyWhitespace = false,
  this.trimWhitespace = true,
  this.pattern,
  this.blacklistedWords = const {},
  this.allowedCharacters,
  this.wholeWordBlacklist = false,
});