isOkAnd method

bool isOkAnd(
  1. bool predicate(
    1. T value
    )
)

Check if Result is Ok and the value satisfies a predicate.

Implementation

bool isOkAnd(bool Function(T value) predicate) {
  if (this is Ok<T, E>) {
    final value = (this as Ok<T, E>).value;
    return predicate(value);
  }
  return false;
}