HttpResponse<T>.failureFromError constructor

HttpResponse<T>.failureFromError([
  1. HttpException? error
])

Implementation

HttpResponse.failureFromError([HttpException? error]) {
  error = error ?? UnknownException();
  ok = false;
  if(isHttpFailingModusOrDialog) {
    DiaLogUtil.showAlertDialog(middleText: error.message ?? '');
  }else{
    Get.snackbar('提示', error.message ?? '',
        colorText: Colors.white, backgroundColor: Colors.black87);
  }
}