whereOrNull method

Iterable<T>? whereOrNull(
  1. bool predicate(
    1. T
    )
)

Returns the filtered elements of the list if it is success or null

Implementation

Iterable<T>? whereOrNull(bool Function(T) predicate) => match(
      onSuccess: (list) => list.where(predicate),
      onError: (e) => null,
    );