onRefresh static method

Future onRefresh(
  1. EasyRefreshController refreshController,
  2. dynamic fn()
)

UtilRefresh 刷新工具类

Implementation

static Future onRefresh(EasyRefreshController refreshController, Function() fn) async {
  try {
    await fn();
    refreshController.finishRefresh();
  } catch (e, s) {
    refreshController.finishRefresh(IndicatorResult.fail);
    LogService.instance.reportError('下拉刷新', e, s);
  } finally {
    refreshController.resetFooter();
  }
}