filter method

  1. @override
None<T> filter(
  1. @noFutures bool noFutures(
    1. T value
    )
)
override

Returns None if the predicate noFutures returns false. Otherwise, returns the original Option.

⚠️ Callback must not throw

Option<T> has no Err variant. Throwing predicates escape to the caller. If your predicate can fail, lift it via Sync(() => p(value)).

Implementation

@override
@pragma('vm:prefer-inline')
None<T> filter(@noFutures bool Function(T value) noFutures) {
  return const None();
}