firstOrNull method

T? firstOrNull()

Implementation

T? firstOrNull() {
  return isEmpty ? null : first;
}