Di Scope

The DiScope class is at the heart of this Lifecycle Awareness approach. It works side by side with LifecycleOwner to give ability to define a scope, register its dependencies, and automatically dispose of it when it’s no longer needed.

Attributes:

Name
Type
Description
Default Value
Required
Nullable
name
String
The identifier for the scope, which helps in managing and referencing the scope.-
factory
GetIt Function()
The function that initializes the scope’s dependencies.-
dispose
bool
Controls whether the scope can be disposed independently of its LifecycleOwner. If dispose is set to true, the scope can be manually disposed outside the context of the screen lifecycle.
false
disposeByOwner
bool
Determines whether the scope is disposed when the lifecycle owner (e.g., the screen) is disposed.
true
dependencies
List<DiScope>
Array of other scopes that need to be initialized before the current scope.
[]