maxOrThrow property

T get maxOrThrow

Largest element. Throws StateError if empty.

Implementation

T get maxOrThrow => maxOrNull ?? (throw StateError('Empty iterable.'));