buildRefreshList method
Widget
buildRefreshList({
- Key? key,
- required Widget child,
- RefreshController? controller,
- Widget? refreshHeader,
- bool enableRefresh = true,
- bool enableLoadMore = true,
- bool enableTwoLevel = false,
- OnTwoLevel? onTwoLevel,
- DragStartBehavior? dragStartBehavior,
- bool? primary,
- double? cacheExtent,
- int? semanticChildCount,
- bool? reverse,
- ScrollPhysics? physics = const BouncingScrollPhysics(),
- Axis scrollDirection = Axis.vertical,
- ScrollController? scrollController,
- List<
Widget> headers = const [], - EmptyConfig? emptyConfig,
See SmartRefresher
Implementation
Widget buildRefreshList({
Key? key,
required Widget child,
RefreshController? controller,
Widget? refreshHeader,
Widget? refreshFooter,
bool enableRefresh = true,
bool enableLoadMore = true,
bool enableTwoLevel = false,
OnTwoLevel? onTwoLevel,
DragStartBehavior? dragStartBehavior,
bool? primary,
double? cacheExtent,
int? semanticChildCount,
bool? reverse,
ScrollPhysics? physics = const BouncingScrollPhysics(),
Axis scrollDirection = Axis.vertical,
ScrollController? scrollController,
List<Widget> headers = const [],
List<Widget> footers = const [],
EmptyConfig? emptyConfig,
}) {
this._headers = headers;
this._footers = footers;
if (controller != null) {
_refreshController = controller;
}
mEmptyConfig = emptyConfig ?? RefreshConfiguration.of(context)?.emptyConfig;
mEmptyConfig?.onPress = () {
refresh();
};
return SmartRefresher(
key: key,
controller: _refreshController,
header: refreshHeader,
footer: refreshFooter,
enablePullDown: enableRefresh,
enablePullUp: enableLoadMore && items.isNotEmpty,
enableTwoLevel: enableTwoLevel,
onTwoLevel: onTwoLevel,
dragStartBehavior: dragStartBehavior,
primary: primary,
cacheExtent: cacheExtent,
semanticChildCount: semanticChildCount,
reverse: reverse,
physics: physics,
scrollDirection: scrollDirection,
scrollController: scrollController,
onRefresh: refresh,
onLoading: () => loadMore(_page + 1),
child: itemCount < 1 && !inLoading ? buildEmptyView(mEmptyConfig) : child,
);
}