HttpResponse<T>.failure constructor

HttpResponse<T>.failure({
  1. String? errorMsg,
  2. String? errorCode,
})

Implementation

HttpResponse.failure({String? errorMsg, String? errorCode}) {
  error = BadRequestException(message: errorMsg, code: errorCode);
  ok = false;
  if(isHttpFailingModusOrDialog) {
    DiaLogUtil.showAlertDialog(middleText: errorMsg ?? '');
  }else{
    Get.snackbar('提示', errorMsg ?? '',
        colorText: Colors.white, backgroundColor: Colors.black87);
  }
}