firstWhere method

  1. @override
E firstWhere (
  1. bool test(
    1. E
    ),
  2. {E orElse(
      )}
    )
    inherited

    Returns the first element that satisfies the given predicate test.

    Iterates through elements and returns the first to satisfy test.

    If no element satisfies test, the result of invoking the orElse function is returned. If orElse is omitted, it defaults to throwing a StateError.

    Implementation

    @override
    E firstWhere(bool Function(E) test, {E Function() orElse}) =>
        _base.firstWhere(test, orElse: orElse);