firstOrNull method
T?
firstOrNull()
Returns first element if list is not empty.
Implementation
T? firstOrNull() => isEmpty ? null : first;
Returns first element if list is not empty.
T? firstOrNull() => isEmpty ? null : first;