Pair<K, V> class

Represents a generic pair of two values.

Annotations
  • @immutable
  • @Deprecated('Deprecated in favor of Records in Dart 3. Use Record instead')

Constructors

Pair(K first, V second)
Creates a new instance of Pair

Properties

first → K
First value of pair.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
second → V
Second value of pair.
final

Methods

copyWith({K? first, V? second}) Pair<K, V>
Allows to create a new pair from this pair, but will different values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<K, V>
Converts this pair into a map
toString() String
A string representation of this object.
override

Operators

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