max method
- return the element with the max value
! throws
StateError
if isEmpty
Implementation
num max() => maxOrNull() ?? (throw StateError('list is empty'));
StateError
if isEmptynum max() => maxOrNull() ?? (throw StateError('list is empty'));