Inst extension

on

Methods

call<T>() → T

Available on FlowerInterface, provided by the Inst extension

create<S>(InstanceBuilderCallback<S> builder, {String? tag, bool permanent = true}) → void

Available on FlowerInterface, provided by the Inst extension

Creates a new Class Instance S from the builder callbackS. Every time find<S>() is used, it calls the builder method to generate a new Instance S. It also registers each instance.onClose() with the current Route Get.reference to keep the lifecycle active. Is important to know that the instances created are only stored per Route. So, if you call Get.delete<T>() the "instance factory" used in this method (Get.create<T>()) will be removed, but NOT the instances already created by it.
delete<S>({String? tag, String? key, bool force = false}) bool

Available on FlowerInterface, provided by the Inst extension

Delete registered Class Instance S (or tag) and, closes any open controllers DisposableInterface, cleans up the memory
deleteAll({bool force = false}) → void

Available on FlowerInterface, provided by the Inst extension

Delete all registered Class Instances and, closes any open controllers DisposableInterface, cleans up the memory
find<S>({String? tag}) → S

Available on FlowerInterface, provided by the Inst extension

Finds the registered type <S> (or tag) In case of using Get.create to register a type <S> or tag, it will create an instance each time you call find. If the registered type <S> (or tag) is a Controller, it will initialize it's lifecycle.
getInstanceInfo<S>({String? tag}) InstanceInfo

Available on FlowerInterface, provided by the Inst extension

isPrepared<S>({String? tag}) bool

Available on FlowerInterface, provided by the Inst extension

Checks if a lazy factory callback Get.lazyPut() that returns an Instance<S> is registered in memory.
isRegistered<S>({String? tag}) bool

Available on FlowerInterface, provided by the Inst extension

Check if a Class Instance<S> (or tag) is registered in memory.
lazyRegister<S>(InstanceBuilderCallback<S> builder, {String? tag, bool? fenix, bool permanent = false}) → void

Available on FlowerInterface, provided by the Inst extension

Creates a new Instance lazily from the <S>builder() callback.
lazyReplace<P>(InstanceBuilderCallback<P> builder, {String? tag, bool? fenix}) → void

Available on FlowerInterface, provided by the Inst extension

Replaces a parent instance with a new Instance
markAsDirty<S>({String? tag, String? key}) → void

Available on FlowerInterface, provided by the Inst extension

register<C>(C dependency, {String? tag, bool permanent = false}) → C

Available on FlowerInterface, provided by the Inst extension

Holds a reference to every registered callback when using Get.lazyPut()
registerOrFind<S>(InstanceBuilderCallback<S> dep, {String? tag}) → S

Available on FlowerInterface, provided by the Inst extension

reload<S>({String? tag, String? key, bool force = false}) → void

Available on FlowerInterface, provided by the Inst extension

reloadAll({bool force = false}) → void

Available on FlowerInterface, provided by the Inst extension

replace<P>(P child, {String? tag}) → void

Available on FlowerInterface, provided by the Inst extension

Replace a parent instance of a class in dependency management with a child instance
resetInstance({bool clearRouteBindings = true}) bool

Available on FlowerInterface, provided by the Inst extension

Clears all registered instances (and/or tags). Even the persistent ones. This should be used at the end or tearDown of unit tests.