firstOr method Null safety

T? firstOr(
  1. [T? ifEmpty]
)

Implementation

T? firstOr([T? ifEmpty]) {
  if (this.isEmpty) return ifEmpty;
  return this.first;
}