YRefreshStaticListView function

Widget YRefreshStaticListView({
  1. required List<Widget> children,
  2. dynamic onRefresh()?,
  3. ScrollController? scrollController,
  4. Header? header,
  5. Footer? footer,
  6. dynamic onLoadMore()?,
  7. dynamic bottomBouncing = true,
  8. dynamic scrollbar = true,
  9. EdgeInsets padding = EdgeInsets.zero,
})

Implementation

Widget YRefreshStaticListView({required List<Widget> children, Function()? onRefresh, ScrollController? scrollController, Header? header, Footer? footer, Function()? onLoadMore, bottomBouncing = true, scrollbar = true, EdgeInsets padding = EdgeInsets.zero}) {
  var easyRefresh = EasyRefresh(
    onRefresh: onRefresh != null ? () => onRefresh() : null,
    onLoad: onLoadMore != null ? () => onLoadMore() : null,
    bottomBouncing: bottomBouncing,
    scrollController: scrollController,
    header: header ?? (onRefresh != null ? BezierCircleHeader(backgroundColor: YConfig.themeColor.withOpacity(0.1), color: YConfig.themeColor) : null),
    footer: footer ?? (onLoadMore != null ? BallPulseFooter(backgroundColor: YConfig.themeColor.withOpacity(0.1), color: YConfig.themeColor, enableInfiniteLoad: false) : null),
    child: Container(
      constraints: const BoxConstraints(minHeight: 300),
      child: ListView(
        padding: padding,
        primary: false,
        shrinkWrap: true,
        children: children,
      ),
    ),
  );
  return scrollbar ? Scrollbar(child: easyRefresh) : easyRefresh;
}