refreshData method

Future refreshData([
  1. bool needLoading = false
])

刷新数据 会重置加载状态

Implementation

Future refreshData([bool needLoading = false]) async {
  if (needLoading) loading();
  await initData().then((_) {
    refreshController.refreshCompleted();
    // 重置加载状态
    refreshController.loadComplete();
  }).catchError((e, trace) {
    refreshController.refreshFailed();
    // 重置加载状态
    refreshController.loadComplete();
    log("RefreshData Error", error: e, stackTrace: trace);
  });
}