DI class
A thin facade over GetX's Get that enables ownership tracking.
When called inside a BindingScope, DI records what the scope actually
created so the scope can delete exactly those on dispose. Outside any scope,
DI just delegates to Get without tracking.
Extra behavior:
putAsync<T>implements first-registrant-wins semantics. While the first async install is in flight, later callers wait and then borrow the created instance. This prevents races and double-ownership.- Async installs are tracked so scopes can clean up both immediately and even if the install completes after the scope is disposed.
Constructors
- DI()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create<
T> (InstanceBuilderCallback< T> builder, {String? tag}) → void - Registers a factory that creates a new instance on each find, and records scope ownership of the factory registration.
-
find<
T> ({String? tag}) → T - Convenience wrappers.
-
isRegistered<
T> ({String? tag}) → bool -
lazyPut<
T> (InstanceBuilderCallback< T> builder, {String? tag, bool fenix = false}) → void - Registers a lazy factory if absent, and records scope ownership.
-
put<
T> (T dependency, {String? tag, bool permanent = false, bool? overrideSmartManagement}) → T - Registers (or reuses) an instance.
-
putAsync<
T> (AsyncInstanceBuilderCallback< T> builder, {String? tag, bool permanent = false}) → Future<T> - Registers an async instance with first-registrant-wins semantics.