MapBuilder<K, V> class Null safety

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.


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


hashCode int
The hash code for this object. [...]
read-only, inherited
isEmpty bool
As Map.isEmpty.
isNotEmpty bool
As Map.isNotEmpty.
length int
As Map.length.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


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 non-existent method or property is accessed. [...]
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. [...]
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>.


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