krefreshBuilder function

Widget krefreshBuilder(
  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 krefreshBuilder(
  Widget child,
  AbsPageLogic logic, {
  bool enableRefresh = true,
  bool enableUp = true,
  Header? header,
  Footer? footer,
}) {
  return EasyRefresh.builder(
    childBuilder: (BuildContext context, ScrollPhysics physics) {
      return child;
    },
    onRefresh: enableRefresh ? logic.onRefresh : null,
    onLoad: enableUp ? logic.onLoadMore : null,
    header: header,
    footer: footer,
    controller: logic.refreshController,
  );
}