onSuccess method

void onSuccess(
  1. RefreshType type,
  2. bool isLastPage
)

加载成功 isLastPage是否最后一页

Implementation

void onSuccess(RefreshType type, bool isLastPage) {
  if (type == RefreshType.up) {
    if (isLastPage) {
      //最后一页
      refreshController.finishLoad(IndicatorResult.noMore);
    } else {
      refreshController.finishLoad(IndicatorResult.success);
    }
  } else if (type == RefreshType.refresh) {
    refreshController.finishRefresh();
    refreshController.resetFooter();
  } else if (type == RefreshType.first) {
    refreshController.resetFooter();
  }
}