ApplicationContainer class

Application container that manages modules and dependency injection Provides centralized service resolution with module-based encapsulation

Constructors

ApplicationContainer([GetIt? getIt])

Properties

context → ModuleContext
Get the module context (useful for testing and debugging)
no setter
getIt → GetIt
Get the underlying GetIt instance (use with caution - bypasses module restrictions)
no setter
hashCode → int
The hash code for this object.
no setterinherited
isReady → bool
Check if the container is ready (all modules initialized)
no setter
modules → List<Module>
Get all registered modules
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

allReady({Duration? timeout, bool ignorePendingAsyncCreation = false}) → Future<void>
Wait for all services to be ready (delegates to GetIt)
get<T extends Object>({String? instanceName}) → T
Get a service instance from the container Services are accessible if they are available from registered modules
getAsync<T extends Object>({String? instanceName}) → Future<T>
Get async service instance
getAvailableServices() → Set<Type>
Get all services available to the root container
getWithParams<T extends Object>(dynamic param1, [dynamic param2]) → T
Get a service instance with parameters
isRegistered<T extends Object>({String? instanceName}) → bool
Check if a service is registered and accessible
isRegisteredInContainer<T extends Object>({String? instanceName}) → bool
Check if a service is registered in the underlying container (ignoring exports)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerModule(Module module) → Future<void>
Register a module with the container Makes the module's exported services available to the application
registerModules(List<Module> modules) → Future<void>
Register multiple modules at once
reset() → Future<void>
Reset the container (useful for testing)
toString() → String
A string representation of this object.
inherited
waitUntilReady({Duration? timeout}) → Future<void>
Wait for the container to be ready

Operators

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