Ahmed Fwela

simple refactor

... ... @@ -162,30 +162,23 @@ class GetInstance {
}) {
final key = _getKey(S, name);
_InstanceBuilderFactory<S>? dep;
if (_singl.containsKey(key)) {
final dep = _singl[key];
if (dep != null && dep.isDirty) {
_singl[key] = _InstanceBuilderFactory<S>(
isSingleton,
builder,
permanent,
false,
fenix,
name,
lateRemove: dep as _InstanceBuilderFactory<S>,
);
final _dep = _singl[key];
if (_dep != null && _dep.isDirty) {
dep = _dep as _InstanceBuilderFactory<S>;
}
}
} else {
_singl[key] = _InstanceBuilderFactory<S>(
isSingleton,
builder,
permanent,
false,
fenix,
name,
isSingleton: isSingleton,
builderFunc: builder,
permanent: permanent,
isInit: false,
fenix: fenix,
tag: name,
lateRemove: dep,
);
}
}
/// Initializes the dependencies for a Class Instance [S] (or tag),
/// If its a Controller, it starts the lifecycle process.
... ... @@ -518,14 +511,14 @@ class _InstanceBuilderFactory<S> {
String? tag;
_InstanceBuilderFactory(
this.isSingleton,
this.builderFunc,
this.permanent,
this.isInit,
this.fenix,
this.tag, {
this.lateRemove,
_InstanceBuilderFactory({
required this.isSingleton,
required this.builderFunc,
required this.permanent,
required this.isInit,
required this.fenix,
required this.tag,
required this.lateRemove,
});
void _showInitLog() {
... ...