setup method
void
setup({
- required String requestUrl,
- Map<
String, dynamic> ? requestParams, - Options? requestOptions,
- CancelToken? cancelToken,
- required List<
T> jsonParse(), - int page = 1,
- int? pageSize,
- dynamic onBegin(
- bool loadMore
- dynamic onSuccess()?,
- dynamic onFailed()?,
- dynamic onCommon(
- bool loadMore
- 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;
}