firstOrNull property

T? firstOrNull

Returns the first element.

If this is empty, the result of invoking is null. Otherwise returns the first element in the iteration order, equivalent to this.elementAt(0).

Implementation

T? get firstOrNull => this.firstWhereOrNull((_) => true);