mapOrNull<U> method

U? mapOrNull<U>(
  1. U transform(
    1. T
    )
)

Returns a transformed value or null

Implementation

U? mapOrNull<U>(U Function(T) transform) => switch (this) {
      Success(value: final v) => transform(v),
      _ => null,
    };