loading method
Widget
loading(
- NotifierBuilder<
T?> widget, { - Widget? onError(
- MError? error
- Widget? onLoading,
- double? loadingIndicatorSize,
- AlignmentGeometry? alignment,
- Widget? onEmpty,
- String? emptyText,
- WidgetBuilder? onCustom,
- bool showLoading = true,
- bool showError = true,
- bool showEmpty = true,
- bool isStateless = false,
Implementation
Widget loading(
NotifierBuilder<T?> widget, {
Widget? Function(MError? error)? onError,
Widget? onLoading,
double? loadingIndicatorSize,
AlignmentGeometry? alignment,
Widget? onEmpty,
String? emptyText,
WidgetBuilder? onCustom,
bool showLoading = true,
bool showError = true,
bool showEmpty = true,
bool isStateless = false,
}) {
showLoading = isStateless ? false : showLoading;
showError = isStateless ? false : showError;
showEmpty = isStateless ? false : showEmpty;
return mobx(
widget,
onError: showError ? onError ?? _onError : (error) => Container(),
onLoading: showLoading
? onLoading ??
_onLoadingIndicator(
size: loadingIndicatorSize,
alignment: alignment,
)
: Container(),
onEmpty: showEmpty
? onEmpty ??
_onEmpty(
emptyText: emptyText,
)
: Container(),
onCustom: onCustom,
);
}