onSuccess method

Result<T> onSuccess({
  1. required void action(
    1. T value
    ),
})

Performs the given action on the encapsulated value if this instance represents Result.isSuccess. Returns the original Result unchanged.

Implementation

Result<T> onSuccess({required void Function(T value) action}) =>
    this.._actionIfSuccess(action: action);