krefresh function

Widget krefresh(
  1. Widget child,
  2. AbsPageLogic logic, {
  3. bool enableRefresh = true,
  4. bool enableUp = true,
  5. Header? header,
  6. Footer? footer,
})

下拉刷新和上拉加载 child子控件 enableRefresh 是否启用下拉刷新 enableUp 是否启动上拉加载

Implementation

Widget krefresh(
  Widget child,
  AbsPageLogic logic, {
  bool enableRefresh = true,
  bool enableUp = true,
  Header? header,
  Footer? footer,
}) {
  return EasyRefresh(
    controller: logic.refreshController,
    header: header,
    footer: footer,
    onLoad: enableUp ? logic.onLoadMore : null,
    onRefresh: enableRefresh ? logic.onRefresh : null,
    notRefreshHeader: const NotRefreshHeader(),
    child: child,
  );
}