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

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, events and the rest of registries, 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.plugins for 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 id off at the next step boundary.
enable(String id) → void
Switches id on at the next step boundary.
installAll(Iterable<Flutter3dPlugin> plugins) → void
Checks plugins and 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 id is 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 preferred at 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 ready of every plugin installed so far has — Flutter3dPlugin.ready — whether it loaded or threw. A plugin whose ready threw is switched off at the next step boundary, with its dependents; statuses says why.

Operators

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