Option<R>.fromPredicate constructor
Option<R>.fromPredicate (
- R value,
- bool predicate(
- R r
Implementation
factory Option.fromPredicate(R value, bool Function(R r) predicate) {
if (predicate(value)) return Some(value);
return const None();
}