IListConst<T> constructor
To create an empty constant IList: const IListConst([])
.
To create a constant list with items: const IListConst([1, 2, 3])
.
IMPORTANT: You must always use the const
keyword.
It's always wrong to use an IListConst
which is not constant.
Implementation
@literal
const IListConst(this._list,
// Note: The _list can't be optional. This doesn't work: [this._list = const []]
// because when you do this _list will be List<Never> which is bad.
[this.config = const ConfigList()])
: super._gen();