signalReady method

void signalReady(
  1. Object instance
)

Used to manually signal the ready state of a Singleton. If you want to use this mechanism you have to pass signalsReady==true when registering the Singleton. If instance has a value GetIt will search for the responsible Singleton and completes all futures that might be waited for by isReady If all waiting singletons have signalled ready the future you can get from allReady is automatically completed

Typically this is used in this way inside the registered objects init method GetIt.instance.signalReady(this);

if instance is null and no factory/singleton is waiting to be signalled this will complete the future you got from allReady, so it can be used to globally giving a ready Signal

Both ways are mutual exclusive, meaning either only use the global signalReady() and don't register a singleton to signal ready or use any async registrations

Or use async registrations methods or let individual instances signal their ready state on their own.

Implementation

void signalReady(Object instance) => locator.signalReady(instance);