Skip to main content
1

πŸ” Ends of the List

T?
Gets the first element of the list, or returns null if the list is empty. Prevents StateError.
T?
Gets the last element of the list, or returns null if the list is empty. Prevents StateError.
2

πŸ” Index & Element Access

T?
Safely retrieves an element at a given index, returning null if the index is out of bounds. Prevents RangeError.
int?
Gets the index of the element, or returns null if the element doesn’t exist in the list.
T?
Gets the first element that satisfies the test, or returns null if none is found. Prevents StateError without needing an orElse callback.