headOption property

T? headOption

safely access first element of list that may be empty.

Implementation

T? get headOption => isEmpty ? null : first;