DuskPlugin class
fluttersdk_dusk plugin install entry. Idempotent.
Host integration:
void main() {
WidgetsFlutterBinding.ensureInitialized();
if (kDebugMode) {
DuskPlugin.install();
}
runApp(kDebugMode ? RepaintBoundary(child: app) : app);
}
V1 compile-time gate is just kDebugMode — release builds tree-shake
the entire DuskPlugin 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.WindDebugRegistryinstead, read byext_snapshot.dart/ext_observe.dartdirectly.
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 -
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
_installCountfor tests.no setter -
Consumer-registered router adapter consulted by
ext.dusk.navigatebefore falling back to SystemNavigator.routeInformationUpdated. Null when no adapter is wired — dusk stays framework-agnostic.no setter
Static Methods
-
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.
-
Wires a router adapter. Subsequent calls overwrite the previous
adapter so hot-reload tests can rebind cleanly. Passing
nullclears the adapter (back to framework-agnostic broadcast).