baseRefresh method
Widget
baseRefresh(
- NotifierBuilder<
T?> widget, { - required EasyRefreshController refreshController,
- Widget onEmptyWidget(
- String? message
- OnRefreshCallback? onRefresh,
- OnLoadCallback? onLoad,
- void onLoadTap()?,
Implementation
Widget baseRefresh(
NotifierBuilder<T?> widget, {
required EasyRefreshController refreshController,
Widget Function(String? message)? onEmptyWidget,
OnRefreshCallback? onRefresh,
OnLoadCallback? onLoad,
void Function()? onLoadTap,
}) {
return SimpleBuilder(builder: (_) {
return BaseRefresh(
controller: refreshController,
emptyWidget: state.isEmptyOrNull
? (onEmptyWidget != null
? onEmptyWidget(status.errorMessage)
: BasePlaceholderView(
title: status.errorMessage,
onTap: onLoadTap ?? () => refreshController.callRefresh(),
))
: null,
onRefresh: onRefresh,
onLoad: onLoad,
child: widget(state),
);
});
}