BaseApi<T> constructor

BaseApi<T>(
  1. dynamic path, {
  2. dynamic param,
  3. Options? opt,
  4. String method = 'POST',
  5. Map<String, dynamic>? queryParameters,
  6. bool isDebug = true,
  7. CancelToken? cancelToken,
  8. TransformJson<T>? serializer,
  9. bool showLoading = true,
  10. bool dismissLoading = true,
  11. bool showToast = true,
  12. bool encrypt = false,
  13. bool cache = false,
  14. bool showLog = true,
})

Implementation

BaseApi(
  this.path, {
  this.param,
  this.opt,
  this.method = 'POST',
  this.queryParameters,
  this.isDebug = true,
  this.cancelToken,
  this.serializer,
  this.showLoading = true,
  this.dismissLoading = true,
  this.showToast = true,
  this.encrypt = false,
  this.cache = false,
  this.showLog = true,
}) {
  if (this.opt == null) {
    this.opt = Options(method: method, extra: {"BaseApi": this});
  } else {
    this.opt = this.opt!.copyWith(extra: {"BaseApi": this});
    this.opt?.method ??= method;
  }
}