PluginManager class final
The plugins of one engine: checked, ordered, installed, and switched on and off at step boundaries.
The plugin host. The loop owns one and calls applyPending at every step boundary; nothing else installs or removes a plugin, so no plugin arrives or leaves in the middle of a step.
What it checks before anything is installed
- every id is well formed and unique;
- every plugin's API version is one this engine provides (PluginApiVersion.refusalOn says why not);
- every dependency is among the plugins, and the dependencies have no cycle — a ConstraintCycleException names the plugins in it;
- every dependency's PluginManifest.version is in the range its dependent names (PluginDependency.refusalOf says why not).
Order
Plugins install in dependency order, and where dependencies leave a choice, in the order they were given (or last reordered into). The order is also each plugin's rank, which breaks ties between registrations in every registry.
Switching at run time
enable, disable and reorder are checked when they are asked for — a disable that would strand an enabled dependent throws then, naming it — and carried out at the next step boundary, where they are journalled. schedule hands a replay the journal of a recorded run, and the same changes are made at the same steps.
Constructors
-
PluginManager({required LoopRegistry loop, required EventRegistry events, Iterable<
PluginRegistry> registries = const <PluginRegistry>[], String? backend, PluginApiVersion apiVersion = PluginApiVersion.current, SimulationProfile profile = SimulationProfile.deterministic}) -
A manager for one engine's plugins, registering through
loop,eventsand the rest ofregistries, which a plugin finds by type.
Properties
- apiVersion → PluginApiVersion
-
The API this engine provides.
final
- backend → BackendId?
-
The graphics backend, matched against each manifest's backends, and
what each plugin is told as
PluginHost.backend: a BackendId since 1.0.0-rc.2.final - events → EventRegistry
-
The engine's event bus, through which each plugin's view is made.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasPending → bool
-
Whether anything is waiting for the next step boundary.
no setter
-
journal
→ List<
PluginChange> -
Every change applied since the engine started, oldest first.
no setter
- loop → LoopRegistry
-
The engine's loop: its phases, systems and assimilations, through which
each plugin's view is made.
final
-
order
→ List<
String> -
The plugins in install order.
no setter
- profile → SimulationProfile
-
What the engine's simulation promises about its numbers, handed to
every plugin as
PluginHost.profile.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
simulationVersions
→ Map<
String, int> -
Every enabled plugin that touches the simulation, by id, with its own
simulation number:
SimulationVersion.pluginsfor this engine.no setter -
statuses
→ List<
PluginStatus> -
Every plugin's status, in install order.
no setter
Methods
-
applyPending(
int step) → List< PluginChange> -
Carries out what is due at the boundary before step
step: scheduled changes first, in step order, then what was asked for since the last boundary, in the order it was asked. Returns what was applied, which is also added to journal. -
disable(
String id) → void -
Switches
idoff at the next step boundary. -
enable(
String id) → void -
Switches
idon at the next step boundary. -
installAll(
Iterable< Flutter3dPlugin> plugins) → void -
Checks
pluginsand installs every one that can run, in dependency order. Once, before the first step. -
installGroup(
PluginGroup group) → void -
Installs
group's plugins, in its order, as installAll does. -
isEnabled(
String id) → bool -
Whether
idis installed and on. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reorder(
List< String> preferred) → void -
Asks for the install order
preferredat the next step boundary. -
schedule(
Iterable< PluginChange> changes) → void -
Makes
changes— a recorded run's journal — at their steps, through applyPending, as a replay reaches them. -
stateAt(
int step) → PluginsSet -
The plugins' whole state as a change at
step: what a recording that begins mid-run writes first. -
toString(
) → String -
A string representation of this object.
inherited
-
whenReady(
) → Future< void> -
Completes once the
readyof every plugin installed so far has —Flutter3dPlugin.ready— whether it loaded or threw. A plugin whosereadythrew is switched off at the next step boundary, with its dependents; statuses says why.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited