ContainsRule class
A rule that checks if a value contains a specific substring.
- Inheritance
-
- Object
- ValidatorRule
- ContainsRule
Constructors
- ContainsRule(String substring, {String? errorMessage})
-
Creates a new ContainsRule with the given
substringand optionalerrorMessage.const
Properties
-
defaultMessage
→ Map<
String, String> -
Provides default error messages in various languages.
no setteroverride
- errorMessage → String?
-
The error message to be displayed if validation fails.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- substring → String
-
The substring that must be contained in the value.
final
Methods
-
isValid(
BuildContext context, String? value) → String? -
Checks if the
valuecontains the substring.override -
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