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.
Constructors
- MapBuilder([dynamic map = const {}])
-
Instantiates with elements from a Map or BuiltMap.
factory
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- isEmpty → bool
-
As Map.isEmpty.
read-only
- isNotEmpty → bool
-
As Map.isNotEmpty.
read-only
- length → int
-
As Map.length.
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
addAll(
Map< K, V> other) → void - As Map.addAll.
-
addEntries(
Iterable< MapEntry< newEntries) → voidK, V> > - 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. [...]
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 instantiatesMap<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.