baseRefresh method

Widget baseRefresh(
  1. NotifierBuilder<T?> widget, {
  2. required EasyRefreshController refreshController,
  3. Widget onEmptyWidget(
    1. String? message
    )?,
  4. OnRefreshCallback? onRefresh,
  5. OnLoadCallback? onLoad,
  6. 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),
    );
  });
}