App class
The main application class that serves as a singleton service container and lifecycle manager for the Archery framework.
Provides dependency injection, provider registration, boot sequence, and configuration management.
- Available extensions
Constructors
- App()
-
Factory constructor returning the singleton instance.
factory
Properties
- container → ServiceContainer
-
Root service container for dependency injection.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status ↔ AppStatus
-
Current status of the application lifecycle.
getter/setter pair
Methods
-
bind<
T> (T instance) → void -
Available on App, provided by the ContainerOperations extension
Binds a concreteinstanceto typeTin the container. -
bindInstance<
T> (T instance) → void -
Available on App, provided by the ContainerOperations extension
Registers a singletoninstanceof typeT. -
boot(
) → Future< void> - Boots the application by initializing core services and providers.
-
make<
T> () → T -
Available on App, provided by the ContainerOperations extension
Alias for resolve. Resolves a registered instance. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onBooted(
void callback()) → void - Adds a callback to be executed when the application has finished booting.
-
register(
Provider provider) → void - Registers a single Provider with the application.
-
registerGroup(
String groupName, List< Provider> providers) → void -
Registers a group of Providers under a logical
groupName. -
resolve<
T> () → T -
Available on App, provided by the ContainerOperations extension
Resolves a registered instance of typeT. -
resolveInstance<
T> () → T -
Available on App, provided by the ContainerOperations extension
Resolves an instance of typeTfrom the container. -
setKeys(
{bool reset = false}) → void -
Ensures
lib/src/config/app.jsonexists and populates it with default config. -
shutdown(
) → Future< void> - Initiates graceful shutdown of the application.
-
toString(
) → String -
A string representation of this object.
inherited
-
tryMake<
T> () → T? -
Available on App, provided by the ContainerOperations extension
Alias for tryResolve. -
tryResolve<
T> () → T? -
Available on App, provided by the ContainerOperations extension
Attempts to resolve an instance of typeT. Returnsnullif not found. -
tryResolveInstance<
T> () → T? -
Available on App, provided by the ContainerOperations extension
Safely attempts to resolve an instance. Returnsnullon failure.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
generateKey(
) → String - Generates a secure random 32-byte key encoded in URL-safe base64.