allReady function
bool
allReady({
- void onReady(
- BuildContext context
- void onError(
- BuildContext context,
- Object? error
- Duration? timeout,
- 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);
}