baseState method
Widget
baseState(
- NotifierBuilder<
T?> widget, { - Widget onPlaceholderWidget()?,
- String? placeholderEmptyImagePath,
- String? placeholderEmptyTitle,
- String? placeholderEmptyMessage,
- void onReloadTap()?,
Implementation
Widget baseState(
NotifierBuilder<T?> widget, {
Widget Function()? onPlaceholderWidget,
String? placeholderEmptyImagePath,
String? placeholderEmptyTitle,
String? placeholderEmptyMessage,
void Function()? onReloadTap,
}) {
return SimpleBuilder(
builder: (_) {
if (status.isLoading ||
status.isEmpty ||
status.isError ||
state.isEmptyOrNull) {
return onPlaceholderWidget != null
? onPlaceholderWidget()
: BasePlaceholderView(
title: getPlaceholderTitle(placeholderEmptyTitle),
message: getPlaceholderMessage(placeholderEmptyMessage),
image: placeholderEmptyImagePath,
onTap: onReloadTap ??
() {
change(null, status: RxStatus.loading());
onRequestData();
},
);
}
return widget(state);
},
);
}