isSomeAnd abstract method

  1. @useResult
bool isSomeAnd(
  1. bool condition(
    1. T value
    )
)

Returns true if this is a Some with a contained value that satisfies condition.

Examples

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

// prints "false"
print(const None<int>().isSomeAnd((value) => value == 2));

Implementation

@useResult
bool isSomeAnd(bool Function(T value) condition);