setValueOrDisplayError method
void
setValueOrDisplayError(
- Future<
ServiceResult> futureServiceResult, - Function setter,
- Function errorHandler, {
- dynamic additionalParam,
Main method to call for instance when a button is clicked. example: setValueOrDisplayError(restSimplified.get
Implementation
void setValueOrDisplayError(Future<ServiceResult> futureServiceResult,
Function setter, Function errorHandler,
{var additionalParam}) {
futureServiceResult.then((value) => {
_callBackSet(setter, errorHandler, value,
additionalParam: additionalParam)
});
futureServiceResult.catchError((error) {
return ServiceResult.onInternalError(error.toString());
});
}