HttpResponse<T>.failure constructor

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

Implementation

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