MapBuilder<K, V> class

The Built Collection builder for BuiltMap.

It implements the mutating part of the Map interface.

See the Built Collection library documentation for the general properties of Built Collections.

Constructors

MapBuilder([dynamic map = const {}])
Instantiates with elements from a Map or BuiltMap.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
As Map.isEmpty.
no setter
isNotEmpty bool
As Map.isNotEmpty.
no setter
length int
As Map.length.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAll(Map<K, V> other) → void
As Map.addAll.
addEntries(Iterable<MapEntry<K, V>> newEntries) → void
As Map.addEntries.
addIterable<T>(Iterable<T> iterable, {K key(T)?, V value(T)?}) → void
As Map.fromIterable but adds.
build() BuiltMap<K, V>
Converts to a BuiltMap.
clear() → void
As Map.clear.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
putIfAbsent(K key, V ifAbsent()) → V
As Map.putIfAbsent.
remove(Object? key) → V?
As Map.remove.
removeWhere(bool predicate(K, V)) → void
As Map.removeWhere.
replace(Object map) → void
Replaces all elements with elements from a Map or BuiltMap.
toString() String
A string representation of this object.
inherited
update(dynamic updates(MapBuilder<K, V> builder)) → void
Applies a function to this.
updateAllValues(V update(K, V)) → void
As Map.updateAll.
updateValue(K key, V update(V), {V ifAbsent()?}) → V
As Map.update.
withBase(_MapFactory<K, V> base) → void
Uses base as the collection type for all maps created by this builder.
withDefaultBase() → void
As withBase, but sets base back to the default value, which instantiates Map<K, V>.

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](Object? key) → V?
As Map.
operator []=(K key, V value) → void
As Map.