firstOrNull method

T? firstOrNull()

Returns first element if list is not empty.

Implementation

T? firstOrNull() => isEmpty ? null : first;