DIPlugin class abstract

DIPlugin is an abstract class that extends the Plugin class.

It is associated with the Dependency Injection (DI) Plugin type and includes methods for registering, unregistering, retrieving, and checking the existence of instances in the DI container.

This class also includes lifecycle management methods and integrates functionality from the PreloadedPlugin mixin.

Inheritance
Mixed-in types
Implementers
Available extensions

Constructors

DIPlugin({required String name, required String title})
Constructs a DIPlugin instance with the given name and title.

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String
finalinherited

Methods

dispose() Future<void>
inherited
get<T extends Object>({String? name}) → T
Retrieves the registered instance of type T from the DI container.
getAsync<T extends Object>({String? name}) Future<T>

Available on DIPlugin, provided by the AsyncLazyDI extension

Retrieves an asynchronously initialized dependency from the dependency injection container.
has<T extends Object>({String? name}) bool
Checks if an instance of the specified type is registered in the DI container.
init() Future<void>
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register<T extends Object>(T instance, {String? name}) → void
Registers an instance of any Object type with the DI container.
registerAsync<T extends Object>(Future<T> fn(), {String? name}) → void

Available on DIPlugin, provided by the AsyncLazyDI extension

Registers a lazily initialized asynchronous dependency in the dependency injection container.
registerFactory<T extends Object>(T fn(), {String? name}) → void
Registers a factory function that produces a new instance each time it is called.
registerLazy<T extends Object>(T fn(), {String? name}) → void
Registers a function that produces an instance of any Object type.
reset() Future<void>
Clears all instances registered in the DI container.
toString() String
A string representation of this object.
inherited
unregister<T extends Object>({String? name}) → void
Removes the instance of the specified type from the DI container.

Operators

operator ==(Object other) bool
The equality operator.
inherited