loaded property

Future<void> get loaded

A future that completes when every component in this iterable has finished loading.

Completes with an error if any of the components failed to load.

final coins = [Coin(), Coin(), Coin()];
world.addAll(coins);
await coins.loaded;

Implementation

Future<void> get loaded => Future.wait(map((component) => component.loaded));