ModuleManager class
Manages all registered modules in the Air Framework.
Provides:
- Module registration with lifecycle management
- Dependency resolution
- Route aggregation
- Module context access
Example:
await ModuleManager().register(HomeModule());
await ModuleManager().register(SettingsModule());
// Access module context
final context = ModuleManager().getContext('home');
- Inheritance
-
- Object
- ChangeNotifier
- ModuleManager
Constructors
- ModuleManager()
-
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
modules
→ List<
AppModule> -
Get all registered modules
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getAirRoutes(
) → List< AirRoute> - Get all routes from all modules (AirRoute) Warns if duplicate routes are found
-
getContext(
String moduleId) → ModuleContext? - Get module context by ID
-
getModule(
String id) → AppModule? - Get a module by ID
-
isInitialized(
String moduleId) → bool - Check if a module is fully initialized
-
isRegistered(
String moduleId) → bool - Check if a module is registered
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
register(
AppModule module) → Future< void> - Register a module with full lifecycle management
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → Future< void> - Clear all modules (for testing)
-
toString(
) → String -
A string representation of this object.
inherited
-
unregister(
String moduleId) → Future< void> - Unregister a module with proper cleanup
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited