roi peker

fixes Get.create() lifecycle.

Replying to an issue spotted by @Quent on Discord, this fixes the lifecycle
( `onInit()`, `onReady()`).
`onClose()` has to be called manually by the dev in the created instance.
... ... @@ -74,3 +74,9 @@ captures/
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
example/macos/Flutter/ephemeral/Flutter-Generated.xcconfig
example/macos/Flutter/ephemeral/
example/macos/Flutter/GeneratedPluginRegistrant.swift
... ...
... ... @@ -159,12 +159,16 @@ class GetInstance {
/// Optionally associating the current Route to the lifetime of the instance,
/// if [GetConfig.smartManagement] is marked as [SmartManagement.full] or
/// [GetConfig.keepFactory]
/// Only flags `isInit` if it's using `Get.create()`
/// (not for Singletons access).
bool _initDependencies<S>({String name}) {
final key = _getKey(S, name);
final isInit = _singl[key].isInit;
if (!isInit) {
_startController<S>(tag: name);
_singl[key].isInit = true;
if (_singl[key].isSingleton) {
_singl[key].isInit = true;
}
if (GetConfig.smartManagement != SmartManagement.onlyBuilder) {
_registerRouteInstance<S>(tag: name);
}
... ...