requestData method

  1. @override
void requestData(
  1. RefreshType type,
  2. int page
)
override

请求数据

Implementation

@override
void requestData(RefreshType type, int page) async {
  if (type == RefreshType.refresh || type == RefreshType.first) {
    list.clear();
  }

  List<T>? data = await requestDataList(page);
  var isLastPage = true;
  if (data != null && data.isNotEmpty) {
    list.addAll(data);
    if (data.length >= pageSize()) {
      isLastPage = false;
    }
  }
  onSuccess(type, isLastPage);
}