DuskPlugin class

fluttersdk_dusk plugin install entry. Idempotent.

Host integration:

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  if (!kReleaseMode) {
    DuskPlugin.install();
  }
  runApp(!kReleaseMode ? RepaintBoundary(child: app) : app);
}

The consumer gates with !kReleaseMode, so a debug AND a profile build both carry DuskPlugin (a profile build is what a real perf session runs against); release builds tree-shake the entire branch on every platform (web dart2js, desktop + mobile dart2native AOT).

Extension points:

  • enrichers: live-read list of snapshot enrichers. Magic registers MagicFormEnricher + MagicNavigationEnricher via this. Wind no longer uses this list as of wind alpha-10; wind diagnostics flow through fluttersdk_wind_diagnostics_contracts.WindDebugRegistry instead, read by ext_snapshot.dart / ext_observe.dart directly.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

aiTestDisableEnvValue ↔ String
Env-var kill switch (build-time via --dart-define=DUSK_DISABLE=1).
getter/setter pair
bootId → String?
The id install minted for this run of main(), answered by ext.dusk.boot_id; null before install.
no setter
enrichers → List<DuskSnapshotEnricher>
Active enricher chain. The snapshot extension iterates this list in insertion order on every snapshot call (live read; mid-session adds are picked up immediately).
final
installCount → int
Exposes _installCount for tests.
no setter
Consumer-registered router adapter consulted by ext.dusk.navigate before falling back to SystemNavigator.routeInformationUpdated. Null when no adapter is wired — dusk stays framework-agnostic.
no setter
semanticsReleased → bool
Whether releaseSemantics dropped dusk's semantics handle and acquireSemantics has not restored it yet.
no setter

Static Methods

acquireSemantics() → bool
Takes dusk's semantics handle again. Returns whether it had to.
install() → void
Idempotent install. Safe to call multiple times within the same isolate lifetime. Hot-restart resets the counter naturally (statics re-run their initializers); the second real install completes fresh.
mintBootId() → String
A boot id: the wall clock in microseconds and a random suffix, base 36, so two boots in the same microsecond still differ.
registerNavigateAdapter(DuskNavigateAdapter? adapter) → void
Wires a router adapter. Subsequent calls overwrite the previous adapter so hot-reload tests can rebind cleanly. Passing null clears the adapter (back to framework-agnostic broadcast).
releaseSemantics() → bool
Drops the handle install took, so the framework stops building the semantics tree every frame. Returns whether one was held.
resetSemanticsForTesting() → void
Disposes whatever handle this class holds and clears the released flag, so a test leaves neither a live handle (the harness asserts every one is disposed) nor a released state for the next test to read.