Inst extension
Main extension on GetInterface providing dependency injection features.
- on
Methods
-
call<
T> () → T -
Available on GetInterface, provided by the Inst extension
A callable shortcut to find/retrieve a registered dependency. -
delete<
S> ({String? tag, String? key, bool force = false}) → bool -
Available on GetInterface, provided by the Inst extension
Delete registered Class InstanceS(ortag) and, closes any open controllersDisposableInterface, cleans up the memory -
deleteAll(
{bool force = false}) → void -
Available on GetInterface, provided by the Inst extension
Deletes all registered instances from memory, invokes their onDelete/close lifecycles, and cleans up resources. -
find<
S> ({String? tag}) → S -
Available on GetInterface, provided by the Inst extension
Finds the registered type <S> (ortag) In case of using Get.create to register a type <S> ortag, it will create an instance each time you call find. If the registered type <S> (ortag) is a Controller, it will initialize its lifecycle. -
findOrNull<
S> ({String? tag}) → S? -
Available on GetInterface, provided by the Inst extension
Finds and returns the registered instance of typeSif it exists, otherwise returnsnull. -
getInstanceInfo<
S> ({String? tag}) → InstanceInfo -
Available on GetInterface, provided by the Inst extension
-
isPrepared<
S> ({String? tag}) → bool -
Available on GetInterface, provided by the Inst extension
Checks whether a lazy factory callback for typeS(and optionally withtag) is registered and ready to be initialized. -
isRegistered<
S> ({String? tag}) → bool -
Available on GetInterface, provided by the Inst extension
Checks whether an instance of typeS(and optionally withtag) is registered in memory. -
lazyPut<
S> (InstanceBuilderCallback< S> builder, {String? tag, bool? fenix, bool permanent = false}) → void -
Available on GetInterface, provided by the Inst extension
Creates a new Instancelazily from the<S>builder()callback. -
lazyReplace<
P> (InstanceBuilderCallback< P> builder, {String? tag, bool? fenix}) → void -
Available on GetInterface, provided by the Inst extension
Replaces an existing registered dependency of typePwith a new lazy factorybuilder. -
markAsDirty<
S> ({String? tag, String? key}) → void -
Available on GetInterface, provided by the Inst extension
-
put<
S> (S dependency, {String? tag, bool permanent = false}) → S -
Available on GetInterface, provided by the Inst extension
Injects adependencyinto the dependency manager and immediately initializes it. -
putOrFind<
S> (InstanceBuilderCallback< S> dep, {String? tag}) → S -
Available on GetInterface, provided by the Inst extension
Finds an existing registered instance of typeS, or creates and registers a new one usingdepif not already registered. -
reload<
S> ({String? tag, String? key, bool force = false}) → void -
Available on GetInterface, provided by the Inst extension
Reloads/restarts a specific registered dependency of typeS. -
reloadAll(
{bool force = false}) → void -
Available on GetInterface, provided by the Inst extension
Reloads all registered instances by clearing their active dependency objects and resetting their initialization states. -
replace<
P> (P child, {String? tag}) → void -
Available on GetInterface, provided by the Inst extension
Replaces an existing registered instance of typePwith a newchildinstance. -
spawn<
S> (InstanceBuilderCallback< S> builder, {String? tag, bool permanent = true}) → void -
Available on GetInterface, provided by the Inst extension
Creates a new Class InstanceSfrom the builder callbackS. Every time find() is used, it calls the builder method to generate a new InstanceS. It also registers eachinstance.onClose()with the current RouteGet.referenceto keep the lifecycle active. Is important to know that the instances created are only stored per Route. So, if you callGet.delete<T>()the "instance factory" used in this method (Get.spawn<T>()) will be removed, but NOT the instances already created by it.