buildLoadingWidgetIfNeeded<S> method

Widget? buildLoadingWidgetIfNeeded<S>(
  1. BuildContext context,
  2. AsyncSnapshot<S> snapshot,
  3. IBlocBuilder widget
)

Builds the loading widget if needed.

Implementation

Widget? buildLoadingWidgetIfNeeded<S>(
  BuildContext context,
  AsyncSnapshot<S> snapshot,
  IBlocBuilder widget,
) {
  if (shouldWaitForData(widget.waitForData, snapshot)) {
    if (widget.loadingBuilder != null) {
      return widget.loadingBuilder!(context);
    }

    return Container();
  }

  return null;
}