QueryParamValidator class

Validates that a URI contains all required query parameters.

Example:

final validator = QueryParamValidator(['page', 'limit']);
validator.isValid(Uri.parse('https://api.com?page=1&limit=10')); // true
validator.isValid(Uri.parse('https://api.com?page=1'));          // false
Implemented types

Constructors

QueryParamValidator(List<String> requiredParams)

Properties

errorMessage String
Gets the error message to display when validation fails.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
requiredParams List<String>
List of required query parameter names
final
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