asMap method

ImmortalMap<int, T> asMap()

Returns an ImmortalMap using the indices of this list as keys and the corresponding objects as values.

Example:

final words = ImmortalList(['fee', 'fi', 'fo', 'fum']);
final map = words.asMap();
map[0].value + map[1].value; // 'feefi'
map.keys.toList();           // [0, 1, 2, 3]

Implementation

ImmortalMap<int, T> asMap() => ImmortalMap(_list.asMap());