filter method

Future<Option<T>> filter(
  1. FutureOr<bool> predicate(
    1. T
    )
)

Implementation

@pragma("vm:prefer-inline")
Future<Option<T>> filter(FutureOr<bool> Function(T) predicate) {
  return then((option) async =>
      option.isSome() && (await predicate(option.v as T)) ? option : None);
}