where method

  1. @override
  2. @useResult
None<T> where(
  1. bool condition(
    1. T value
    )
)
override

Returns a Some of the original value if this is a Some and its contained value satisfies condition, or None otherwise.

Examples

// prints "Some(2)"
print(const Some(2).where((value) => true));

// prints "None"
print(const Some(2).where((value) => false));

Implementation

@override
@useResult
None<T> where(bool Function(T value) condition) => this;