common/result/result library
Classes
Functions
-
tryCall<
S> (FutureOr< S> fn(), {Future<Result< onError(Exception error)?}) → Future<S> >Result< S> > -
Executes the given API call
fn. When the call succeeds, Result.success is returned with the response. When the call fails the optionalonErroris executed and the exceptions are handled. If there is noonErrorprovided, an error of type BaseError is returned in Result.failure.