waitLoaded method

FutureOr<bool> waitLoaded()

Waits for this State load. See onLoad and isLoaded.

Implementation

FutureOr<bool> waitLoaded() {
  if (isLoaded) return true;

  var waitingLoad = _waitingLoad ??= onLoad.first.then((ok) {
    _waitingLoad = null;
    return ok;
  });

  return waitingLoad;
}