where method

Iterable<T> where(
  1. bool predicate(
    1. T
    ), {
  2. required Iterable<T> onError(
    1. E
    ),
})

Performs a filter operation and returns a new instance of T.

Implementation

Iterable<T> where(
  bool Function(T) predicate, {
  required Iterable<T> Function(E) onError,
}) =>
    match(
      onSuccess: (list) => list.where(predicate),
      onError: onError,
    );