Inst extension



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>
Deletes the Instance<S>, 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. [...]
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.
reset({bool clearFactory = true, bool clearRouteBindings = true}) bool
Clears all registered instances (and/or tags). Even the persistent ones. [...]