max method

double? max()

Returns the largest value of all elements

Example:

[9.0, 42.0, 3.0].max(); // 42.0

Implementation

double? max() => maximumBy((a, b) => a.compareTo(b));