shouldWaitForData<S> method

bool shouldWaitForData<S>(
  1. bool canWait,
  2. AsyncSnapshot<S> snapshot
)

Indicates if the BlocBuilder should wait for data. If true, the BlocBuilder will wait for data before building the widget.

Implementation

bool shouldWaitForData<S>(bool canWait, AsyncSnapshot<S> snapshot) {
  final state = snapshot.connectionState;

  return canWait &&
      (state == ConnectionState.waiting || state == ConnectionState.none);
}