baseState method
Implementation
Widget baseState(
NotifierBuilder<T?> widget, {
bool validNullable = true,
Widget Function()? onPlaceholderWidget,
String? placeholderEmptyImagePath,
String? placeholderEmptyTitle,
String? placeholderEmptyMessage,
void Function()? onReloadTap,
}) {
return SimpleBuilder(
builder: (_) {
if (status.isLoading ||
status.isEmpty ||
status.isError ||
(validNullable && 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);
},
);
}