AllowedDomainsValidator class
Validates that a URI's host matches one of the allowed domains.
Example:
final validator = AllowedDomainsValidator(['example.com', 'test.org']);
validator.isValid(Uri.parse('https://sub.example.com')); // true
validator.isValid(Uri.parse('https://forbidden.com')); // false
- Implemented types
Constructors
-
AllowedDomainsValidator(List<
String> allowedDomains)
Properties
-
allowedDomains
→ List<
String> -
List of allowed domain suffixes
final
- errorMessage → String
-
Gets the error message to display when validation fails.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
isValid(
Uri uri) → bool -
Validates whether the given URI meets specific criteria.
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