endRefresh method

void endRefresh({
  1. int? type,
  2. PageState? state,
})

结束刷新

Implementation

void endRefresh({int? type, PageState? state}) {
  bool success = true;
  bool noMore = false;
  if (state == PageState.noMoreDataState) {
    noMore = true;
  }
  if (state == PageState.errorState ||
      state == PageState.erroronlyTotal ||
      state == PageState.errorshowRelesh) {
    success = false;
  }
  if (refreshController != null) {
    if (type == 1) {
      refreshController!.finishRefresh(success: success);
      refreshController!.resetLoadState();
    } else if (type == 2) {
      refreshController!.finishLoad(success: success, noMore: noMore);
    }
  }
  pageState.value = state!;
}