getAsync<T extends Object> method
Retrieves an asynchronously initialized dependency from the dependency injection container.
This function returns the registered Future<T>
for the specified dependency type T
.
T
: The type of the dependency to retrieve.name
: An optional string to specify the name of the dependency.
Returns:
A Future<T>
representing the asynchronous dependency.
Example:
final myServiceFuture = diPlugin.getAsync<MyService>(name: 'myService');
myServiceFuture.then((service) => print('Service initialized: $service'));
Implementation
Future<T> getAsync<T extends Object>({String? name}) => get<Future<T>>(name: name);