IListConst<T> constructor
To create an empty IList: const IListConst([])
.
To create a list with items: const IListConst([1, 2, 3])
.
IMPORTANT: You must always use this with 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 will create problems.
)
: config = const ConfigList(),
super._gen();