loaded property
A future that completes when this component finishes loading.
A component only counts as finished loading once every child that was added during its onLoad has finished loading as well, so awaiting this future guarantees that the subtree created during onLoad is loaded.
If the component is already loaded (see isLoaded), this returns an already completed future. If onLoad threw, this returns a future that completes with that error, every time it is read.
Implementation
Future<void> get loaded {
final loadError = _loadError;
if (loadError != null) {
return Future.error(loadError.error, loadError.stackTrace);
}
return isLoaded
? Future.value()
: (_loadCompleter ??= Completer<void>()).future;
}