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 concrete instance to type T in the container.
bindInstance<T>(T instance) → void

Available on App, provided by the ContainerOperations extension

Registers a singleton instance of type T.
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 type T.
resolveInstance<T>() → T

Available on App, provided by the ContainerOperations extension

Resolves an instance of type T from the container.
setKeys({bool reset = false}) → void
Ensures lib/src/config/app.json exists 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 type T. Returns null if not found.
tryResolveInstance<T>() → T?

Available on App, provided by the ContainerOperations extension

Safely attempts to resolve an instance. Returns null on failure.

Operators

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

Static Properties

version String
The current version of the application.
final

Static Methods

generateKey() String
Generates a secure random 32-byte key encoded in URL-safe base64.