get_it library

Classes

GetIt
Very simple and easy to use service locator You register your object creation factory or an instance of an object with registerFactory, registerSingleton or registerLazySingleton And retrieve the desired object using get or call your locator das as function as its a callable class Additionally GetIt offers asynchronous creation function as well as functions to synchronize the async initialization of multiple Singletons

Functions

throwIf(bool condition, Object error) → void
Two handy function that helps me to express my intention clearer and shorter to check for runtime errors
throwIfNot(bool condition, Object error) → void

Typedefs

FactoryFunc<T>() → T
Signature of the factory function used by normal factories
FactoryFuncAsync<T>() → Future<T>
Signature of the factory function used by async factories
SingletonProviderFunc<T>(Completer initCompleter) → FutureOr<T>
Signature of the factory function used by async Signletons

Exceptions / Errors

WaitingTimeOutException
In case of an timeout while waiting for an instance to get ready This exception is thrown whith information about who is still waiting