ConfigModule class

A ControlModule that integrates control_config with the ControlFactory.

This module ensures that ControlPrefs is initialized and available through the ControlFactory during the application's startup.

By registering ConfigModule, SharedPreferences becomes accessible globally via PrefsProvider.instance or Control.get<ControlPrefs>().

Inheritance
Implemented types

Constructors

ConfigModule()

Properties

entries Map
A map of singleton instances to be registered in the ControlFactory.
no setterinherited
factories Map<Type, InitFactory>
A map of factory functions for lazy object creation, to be registered in the ControlFactory.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Returns true if the module's primary object (module) has been instantiated.
no setterinherited
key Type
The primary type key for this module.
no setterinherited
module ControlPrefs?
The instance of the main object provided by this module.
getter/setter pairinherited
preInit bool
If true, the module's init() method is awaited before other modules begin their initialization.
no setterinherited
priority int
Sets a high priority to ensure ControlPrefs is initialized early.
getter/setter pairinherited-setteroverride-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subModules Map<Type, InitFactory>
A map of other ControlModule types that this module depends on.
no setterinherited

Methods

compareTo(ControlModule other) int
Compares this object to another object.
inherited
getInactiveSubmodules(ControlFactory factory, {Map? args}) List<ControlModule>
inherited
init() Future
Asynchronously mounts (initializes) SharedPreferences.
override
initModule() → void
Initializes the module by either retrieving an existing ControlPrefs instance from the ControlFactory or creating a new one if not present.
override
initStore(ControlFactory factory, {bool includeSubModules = false}) → void
Manually registers the module's entries and factories into a given ControlFactory.
inherited
initWithSubModules(ControlFactory factory, {Map? args}) Future
inherited
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

standalone() bool
Initializes control_config as a standalone module if ControlFactory is not yet initialized.