easyRefreshList function

Widget easyRefreshList({
  1. required List<Widget> children,
  2. EasyRefreshController? controller,
  3. OnRefreshCallback? refresh,
  4. OnLoadCallback? load,
  5. num space = 16,
  6. bool slide = true,
  7. bool isInterval = true,
  8. bool shrinkWrap = false,
  9. num mainPadding = 0,
  10. num crossPadding = 0,
  11. bool fullLine = true,
  12. double? cacheExtent,
  13. Footer? footer,
  14. Header? header,
})

Implementation

Widget easyRefreshList({
  required List<Widget> children,
  EasyRefreshController? controller,
  OnRefreshCallback? refresh,
  OnLoadCallback? load,
  num space = 16,
  bool slide = true,
  bool isInterval = true,
  bool shrinkWrap = false,
  num mainPadding = 0,
  num crossPadding = 0,
  bool fullLine = true,
  double? cacheExtent,
  Footer? footer,
  Header? header,
}) {
  List<Widget> child = [];
  child.add(ListIntervalView.children(
      children: children,
      space: space,
      fullLine: fullLine,
      mainPadding: mainPadding,
      crossPadding: crossPadding));

  Widget view = EasyRefresh.custom(
    controller: controller,
    onRefresh: refresh,
    onLoad: load,
    shrinkWrap: shrinkWrap,
    topBouncing: slide,
    bottomBouncing: slide,
    footer: footer,
    header: header,
    cacheExtent: cacheExtent,
    slivers: <Widget>[SliverList(delegate: SliverChildListDelegate(child))],
  );

  if (!isInterval) {
    view = Container(
      padding: Spacing.all(leftR: crossPadding, topB: mainPadding),
      child: view,
    );
  }

  return view;
}