MapEntry<K, V> class Null safety

A key/value pair representing an entry in a Map.

The Map interface contains various methods that can inspect or modify the map based on entry objects.

final map = {'1': 'A', '2': 'B'};
map.addEntries([
 MapEntry('3', 'C'),
 MapEntry('4', 'D'),
]);
print(map); // {1: A, 2: B, 3: C, 4: D}

Constructors

MapEntry(K key, V value)
Creates an entry with key and value.
const
factory

Properties

hashCode int
The hash code for this object.
read-onlyinherited
key → K
The key of the entry.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
value → V
The value associated to key in the map.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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