Inst extension
Methods
create <S > (InstanceBuilderCallback <S > builder , {String ? tag , bool permanent = true })
→ void
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 GetConfig.currentRoute
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.
Uses tag
as the other methods.
delete <S > ({String ? tag , bool force = false })
→ Future <bool >
Clears all registered instances (and/or tags).
Even the persistent ones.
deleteAll ({bool force = false })
→ Future <void >
Deletes all Instances, cleaning the memory and closes any open
controllers (DisposableInterface
).
find <S > ({String ? tag })
→ S
Finds a Instance of the required Class <S>
(or tag
)
In the case of using Get.create()
, it will generate an Instance
each time you call Get.find()
.
isPrepared <S > ({String ? tag })
→ bool
Checks if an Instance<S>
(or tag
) returned from a factory builder
Get.lazyPut()
, is registered in memory.
isRegistered <S > ({String ? tag })
→ bool
Checks if a Class Instance<S>
(or tag
) is registered in memory.
lazyPut <S > (InstanceBuilderCallback <S > builder , {String ? tag , bool fenix = false })
→ void
Creates a new Instance lazily from the <S>builder()
callback.
lazyReplace <P > (InstanceBuilderCallback <P > builder , {String ? tag , bool ? fenix })
→ void
Replaces a parent instance with a new Instance
put <S > (S dependency , {String ? tag , bool permanent = false , InstanceBuilderCallback <S > ? builder })
→ S
Injects an Instance<S>
in memory.
putAsync <S > (AsyncInstanceBuilderCallback <S > builder , {String ? tag , bool permanent = false })
→ Future <S >
async version of Get.put()
.
Awaits for the resolution of the Future from builder()
parameter and
stores the Instance returned.
reload <S > ({String ? tag , String ? key , bool force = false })
→ void
reloadAll ({bool force = false })
→ void
replace <P > (P child , {String ? tag })
→ void
Replace a parent instance of a class in dependency management
with a child
instance
fluttery_framework 3.1.1+1