max property

Coral<E> get max

Returns the maximum element in this collection, or throws StateError if empty.

Implementation

Coral<E> get max => coral.map((source) {
      if (source.isEmpty) throw StateError('No element');
      return source.reduce((a, b) => a.compareTo(b) > 0 ? a : b);
    });