TextValidationConfig class final
Configuration for generic text validation.
Constructors
-
TextValidationConfig({bool allowEmpty = true, bool allowOnlyWhitespace = true, bool trimWhitespace = false, int? minLength, int? maxLength, String? pattern, String? allowedCharacters, Set<
String> blacklistedWords = const {}}) -
Creates a text validation config.
const
-
TextValidationConfig.required({int? minLength, int? maxLength, String? pattern, String? allowedCharacters, Set<
String> blacklistedWords = const {}, bool trimWhitespace = true}) -
Preset for required text input.
factory
Properties
- allowedCharacters → String?
-
Allowed characters, if restricted.
final
- allowEmpty → bool
-
Whether empty values are allowed.
final
- allowOnlyWhitespace → bool
-
Whether whitespace-only values are allowed.
final
-
blacklistedWords
→ Set<
String> -
Blacklisted words.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxLength → int?
-
Maximum allowed length.
final
- minLength → int?
-
Minimum allowed length.
final
- pattern → String?
-
Required pattern.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trimWhitespace → bool
-
Whether the input should be trimmed before validation.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited