allReady function

bool allReady({
  1. void onReady(
    1. BuildContext context
    )?,
  2. void onError(
    1. BuildContext context,
    2. Object? error
    )?,
  3. Duration? timeout,
  4. bool callHandlerOnlyOnce = false,
})

returns true if all registered async or dependent objects are ready and call onReady and onError handlers when the all-ready state is reached. You can force a timeout Exception if allReady hasn't returned true within timeout. It will trigger a rebuild if this state changes If no onError is passed in it will throw an exception if an error occurs while waiting for the all-ready state. callHandlerOnlyOnce determines if the onReady and onError handlers should be called only once or on every rebuild after the all-ready state has been reached.

Implementation

bool allReady(
    {void Function(BuildContext context)? onReady,
    void Function(BuildContext context, Object? error)? onError,
    Duration? timeout,
    bool callHandlerOnlyOnce = false}) {
  assert(_activeWatchItState != null,
      'allReady can only be called inside a build function within a WatchingWidget or a widget using the WatchItMixin');
  return _activeWatchItState!.allReady(
      onReady: onReady,
      onError: onError,
      timeout: timeout,
      callHandlerOnlyOnce: callHandlerOnlyOnce);
}