UniqueItems<T> class

Validates that a list has a unique set of items.

Uses an O(n²) pairwise DeepCollectionEquality comparison so that nested List and Map elements are compared by structural value rather than by reference. A LinkedHashSet with a deep-equality hasher could give O(n) average-case but would require a matching deep hash function; the pairwise approach is simpler and correct for the expected list sizes in JSON Schema validation.

Implemented types

Constructors

UniqueItems()

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

Methods

call(Iterable 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
uniqueItems(Iterable input) bool
Returns true if all elements are pairwise distinct under deep equality.

Operators

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