map<T1> method
Maps this Result of type T
to an ErrorWrapper of type T1
with
the given mapper
.
Implementation
Result<T1> map<T1>(T1 Function(T) mapper) {
if (hasResult) {
return Result.success(mapper(result()));
}
return Result<T1>.error(error ?? 'Error was not specified');
}