Module class abstract
Abstract base class for all modules in the framework Provides modular dependency injection with controlled service access
Constructors
- Module()
Properties
-
exports
→ List<
Type> -
List of provider types that this module exports to other modules
Only exported services can be accessed by modules that import this module
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
-
imports
→ List<
Module> -
List of modules that this module depends on
Services from imported modules are accessible if they are exported
no setter
- 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
-
onModuleDestroy(
Locator locator, ModuleContext context) → Future< void> - Called when the module is being destroyed/reset Use this for cleanup logic like:
-
onModuleInit(
Locator locator, ModuleContext context) → Future< void> - Called after module registration and dependency resolution Use this for initialization logic like:
-
providers(
Locator locator) → Future< void> - Configure providers/services for dependency injection This method should register all services this module provides Can be async to support services that require async initialization (e.g., SharedPreferences)
-
register(
GetIt getIt, ModuleContext context) → Future< void> - Public method to register this module
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited