IListConst<T> constructor

  1. @literal
const IListConst<T>(
  1. List<T> _list
)

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();