onSuccess method
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);