IMapConst<K, V> constructor
To create an empty constant IMap: const IMapConst({})
.
To create a constant map with entries: const IMapConst({1:'a', 2:'b', 3:'c'})
.
IMPORTANT: You must always use the const
keyword.
It's ALWAYS wrong to use an IMapConst
which is not constant.
Implementation
@literal
const IMapConst(this._map,
// Note: The _map can't be optional. This doesn't work: [this._map = const {}]
// because when you do this _map will be Map<Never, Never> which is bad.
[this.config = const ConfigMap()])
: super._gen();