map<R> method

ProgressDialogResult<R> map<R>(
  1. R fn(
    1. T value
    )
)

Maps the success value to a new value using the provided function

Implementation

ProgressDialogResult<R> map<R>(R Function(T value) fn) {
  return switch (this) {
    Success(:final value) => Success(fn(value)),
    Failure(:final error, :final stackTrace) => Failure(error, stackTrace),
  };
}