asyncMapResult<T> method
Map the current Result
to a new Result
one,
which could be from a different type.
Implementation
Future<Result<T>> asyncMapResult<T>(
Future<T> Function(E) mapSuccess, {
String? tag,
}) async {
final that = this;
if (that is ResultSuccess<E>) {
return Result<T>.success(
await mapSuccess(that.data),
tag: tag ?? that.tag,
);
}
return _mapResultToErrorOrLoading<T>(tag: tag);
}