buildContent method
Implementation
Widget? buildContent(BuildContext context, LoadingMoreBase<T>? source) {
//from stream builder or from refresh
if (source == null ||
(source.isEmpty &&
source.indicatorStatus == IndicatorStatus.fullScreenBusying)) {
if (source == null || !source.isLoading) {
if (autoRefresh) {
//first load
sourceList.refresh();
}
}
Widget? widget;
if (indicatorBuilder != null)
widget = indicatorBuilder!(context, IndicatorStatus.fullScreenBusying);
widget = widget ??
IndicatorWidget(
IndicatorStatus.fullScreenBusying,
isSliver: isSliver,
);
return widget;
}
//empty
else if (source.isEmpty &&
(source.indicatorStatus == IndicatorStatus.empty ||
source.indicatorStatus == IndicatorStatus.fullScreenError)) {
Widget? widget1;
if (indicatorBuilder != null)
widget1 = indicatorBuilder!(context, sourceList.indicatorStatus);
widget1 = widget1 ??
IndicatorWidget(
sourceList.indicatorStatus,
isSliver: isSliver,
tryAgain: source.indicatorStatus == IndicatorStatus.fullScreenError
? () {
sourceList.errorRefresh();
}
: null,
);
return widget1;
}
//show list
//else if (source.length > 0) {
// }
return null;
}