reflection_class library

Classes

Disposable
If objects that are registered inside ReflectionClass implements Disposable the onDispose method will be called whenever that Object is unregistered, resetted or its enclosing Scope is popped
InitDependency
Data structure used to identify a dependency by type and instanceName
ReflectionClass
Very simple and easy to use service locator You register your object creation factory or an instance of an object with registerClass And retrieve the desired object using get or call your locator as function as its a callable class Additionally ReflectionClass offers asynchronous creation functions as well as functions to synchronize the async initialization of multiple Singletons
ShadowChangeHandlers
If an object implements the ShadowChangeHandler if will get notified if an Object with the same registration type and name is registered on a higher scope which will shadow it. It also will get notified if the shadowing object is removed from ReflectionClass
WillSignalReady
If your singleton that you register wants to use the manually signalling of its ready state, it can implement this interface class instead of using the signalsReady parameter of the registration functions (you don't really have to implement much ;-) )

Functions

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

Typedefs

ClassFunc<T> = T Function()
Signature of the class function used by non async factories
ClassFuncParam<T, PARAM> = T Function(PARAM param)
For Factories that expect up to two parameters if you need only one use void for the one you don't use
DisposingFunc<T> = FutureOr Function(T param)
Signature for disposing function because closures like (x){} have a return type of Null we don't use FutureOr<void>
ScopeDisposeFunc = FutureOr Function()
Signature for disposing function on scope level

Exceptions / Errors

WaitingTimeOutException