lastIndex property

int get lastIndex

Returns the index of the last item in the list or -1 if the list is empty.

Implementation

int get lastIndex => size - 1;