setup method

void setup({
  1. required String requestUrl,
  2. Map<String, dynamic>? requestParams,
  3. Options? requestOptions,
  4. CancelToken? cancelToken,
  5. required List<T> jsonParse(
    1. Map<String, dynamic>
    ),
  6. int page = 1,
  7. int? pageSize,
  8. dynamic onBegin(
    1. bool loadMore
    )?,
  9. dynamic onSuccess(
    1. Map<String, dynamic> data,
    2. bool loadMore
    )?,
  10. dynamic onFailed(
    1. int? stateCode,
    2. DioException? error,
    3. bool loadMore
    )?,
  11. dynamic onCommon(
    1. bool loadMore
    )?,
  12. dynamic bind,
})

Implementation

void setup({
  required String requestUrl,
  Map<String, dynamic>? requestParams,
  Options? requestOptions,
  CancelToken? cancelToken,
  required List<T> Function(Map<String, dynamic>) jsonParse,
  int page = 1,
  int? pageSize,
  Function(bool loadMore)? onBegin,
  Function(Map<String, dynamic> data, bool loadMore)? onSuccess,
  Function(int? stateCode, DioException? error, bool loadMore)? onFailed,
  Function(bool loadMore)? onCommon,
  dynamic bind,
}) {
  this.requestUrl = requestUrl;
  this.requestParams = requestParams;
  this.requestOptions = requestOptions;
  this.cancelToken = cancelToken;
  this.jsonParse = jsonParse;
  this.page = page;
  this.pageSize = pageSize;
  this.onBegin = onBegin;
  this.onSuccess = onSuccess;
  this.onFailed = onFailed;
  this.onCommon = onCommon;
  this.bind = bind;
}