Plugin class abstract
An app-level plugin: a self-contained bundle of services, resources, and behaviour that can be installed into a DI scope at runtime and removed cleanly later. Use these to make whole features pluggable — themes, auth providers, analytics backends, optional integrations, etc.
Each installed plugin owns a fresh child DI scope keyed by id. Anything
registered into that scope during install is torn down automatically on
uninstall — including ServiceMixin services, whose dispose() is
cascaded via the standard unregister hook.
Distinct from EcsPlugin (in src/ecs/ecs.dart), which bundles systems
and resources into an ECS World rather than a DI scope.
- Annotations
Constructors
- Plugin()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → Entity
-
Identifies this plugin within a host DI scope. Defaults to
TypeEntity(runtimeType), so only one instance of a givenPluginsubclass can be installed in the same scope at once. Override to support multiple coexisting variants (e.g. multipleThemePlugins keyed by name).no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
install(
DI scope) → Resolvable< Unit> -
Called when this plugin is installed.
scopeis a fresh child DI scope owned by this plugin — register services, resources, and nested scopes here. Everything inscopeis torn down automatically on uninstall. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uninstall(
DI scope) → Resolvable< Unit> -
Called when this plugin is uninstalled, before
scopeis torn down. Use this only for cleanup the registry cannot do automatically — e.g. deregistering from singletons living outsidescope, closing external resources not held as services.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited