Inst extension

on

Methods

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

Available on GetInterface, 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 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>

Available on GetInterface, provided by the Inst extension

Clears all registered instances (and/or tags). Even the persistent ones.
deleteAll({bool force = false}) Future<void>

Available on GetInterface, provided by the Inst extension

Deletes all Instances, cleaning the memory and closes any open controllers (DisposableInterface).
find<S>({String? tag}) → S

Available on GetInterface, provided by the Inst extension

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

Available on GetInterface, provided by the Inst extension

Checks if an Instance<S> (or tag) returned from a factory builder Get.lazyPut(), is registered in memory.
isRegistered<S>({String? tag}) bool

Available on GetInterface, provided by the Inst extension

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

Available on GetInterface, 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 GetInterface, provided by the Inst extension

Replaces a parent instance with a new Instance
put<S>(S dependency, {String? tag, bool permanent = false, InstanceBuilderCallback<S>? builder}) → S

Available on GetInterface, provided by the Inst extension

Injects an Instance<S> in memory.
putAsync<S>(AsyncInstanceBuilderCallback<S> builder, {String? tag, bool permanent = false}) Future<S>

Available on GetInterface, provided by the Inst extension

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

Available on GetInterface, provided by the Inst extension

reloadAll({bool force = false}) → void

Available on GetInterface, provided by the Inst extension

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

Available on GetInterface, provided by the Inst extension

Replace a parent instance of a class in dependency management with a child instance