findOrNull method

R? findOrNull(
  1. bool predicate(
    1. R value
    )
)

Returns the Right.value matching the given predicate, or null if this is a Left or Right.value does not match.

Implementation

R? findOrNull(bool Function(R value) predicate) => switch (this) {
      Left() => null,
      Right(value: final value) => predicate(value) ? value : null,
    };