withDefault method
Returns a mutable view of this Map that responds with the provided default value, when the caller tries to access a non-existent key.
As a consequence, the return type of the accessor V operator [](Object? key) is V and not V? like with a standard Map.
For example:
final map = {'a': 1}.withDefault(42);
print(map['z']); // 42
print(map.containsKey('z')); // false
Implementation
MapWithDefault<K, V> withDefault(V value) => MapWithDefault(this, value);