YRefreshContainer function
Widget
YRefreshContainer({
- required Widget child,
- dynamic onRefresh()?,
- ScrollController? scrollController,
- Header? header,
- dynamic onLoadMore()?,
- dynamic bottomBouncing = true,
- dynamic scrollbar = true,
下拉刷新组件
Implementation
Widget YRefreshContainer({required Widget child, Function()? onRefresh, ScrollController? scrollController, Header? header, Footer? footer, Function()? onLoadMore, bottomBouncing = true, scrollbar = true}) {
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: child,
),
);
return scrollbar ? Scrollbar(child: easyRefresh) : easyRefresh;
}