ConstValidator<T> class

Validates that the input is equal to the specified value.

Uses DeepCollectionEquality for the comparison so that nested List and Map values are compared by structural value rather than by reference. Primitive values (numbers, strings, booleans, null) are handled correctly by deep equality as well.

Implemented types

Constructors

ConstValidator(T value)

Properties

hashCode int
The hash code for this object.
no setteroverride
name String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value ↔ T
The single allowed value.
getter/setter pair

Methods

call(T input) bool
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override