unwrapOrElse method

  1. @override
S unwrapOrElse(
  1. S onError(
    1. F error
    )
)
override

Returns the encapsulated value if this instance represents Ok or the result of onError function for the encapsulated a Err value. Note: This should not be used to determine is Ok or is Err, since when the success type is nullable, the value returned can be null, which is ambiguous in meaning.

Implementation

@override
@pragma("vm:prefer-inline")
S unwrapOrElse(S Function(F error) onError) {
  return onError(err);
}