headOption property
T?
headOption
safely access first element of list that may be empty.
Implementation
T? get headOption => isEmpty ? null : first;
safely access first element of list that may be empty.
T? get headOption => isEmpty ? null : first;