MagicDuskIntegration class

Glues magic's primitives (MagicForm, MagicRouter, Gate, Auth, Echo) into the fluttersdk_dusk snapshot pipeline.

Host integration (debug-only):

if (kDebugMode) {
  DuskPlugin.install();
  MagicDuskIntegration.install();
}

Adds fourteen enrichers to DuskPlugin.enrichers (in insertion order; later enrichers see the same Element, first-write-wins on overlapping keys per oracle finding #3 contract):

  1. magicFormEnrichermagicFormField: <name> for elements backed by a MagicFormData text controller.
  2. magicNavigationEnrichermagicRoute: <currentLocation> for every element when the router has resolved a route.
  3. magicControllerEnrichermagicControllerState: <Class>.<status> for the first registered MagicStateMixin controller.
  4. magicFormErrorsEnrichermagicFormErrors: <field>="<text>",... for elements under a MagicForm whose controller carries server-side ValidatesRequests errors matching the form's fields. Per-field error text is quoted and truncated to 80 chars (...-suffixed).
  5. magicGateResultEnrichermagicGateResult: <ability>.<allowed|denied> for the most recently cached GateResult in Gate.manager.
  6. magicMiddlewareEnrichermagicMiddleware: <name1,name2> for the active route's middlewares via MagicRouter.currentRoute.
  7. magicAuthUserEnrichermagicAuthUser: <id>[:<displayName>] for the authenticated user surfaced by Auth.user.
  8. magicControllerFlagsEnrichermagicControllerFlags: <Class>.isLoading=<bool>,isSuccess=<bool>,isError=<bool>,isEmpty=<bool> for the first registered MagicStateMixin controller.
  9. magicRouteParamsEnrichermagicRouteParams: <k>=<v>,... for the active route's path + query parameters (path params first).
  10. magicEchoConnectionEnrichermagicEchoConnection: connected|reconnecting|disconnected for the current broadcast connection state. Null when the broadcasting provider is not registered.
  11. magicGateResultsAllEnrichermagicGateResultsAll: <ability>=<allowed|denied>,... for up to 5 most recently checked abilities. Null when no ability has been checked yet.
  12. magicRecentHttpEnrichermagicRecentHttp: GET /url 200 142ms,... for up to 5 most recent HTTP records captured by telescope. URLs are truncated to 40 characters. Null when the telescope buffer is empty or the telescope-presence check fails.
  13. magicRecentLogsEnrichermagicRecentLogs: [WARN] msg,[ERROR] msg for up to 3 most recent log records at or above WARNING level. Messages are truncated to 50 characters. Null when the telescope buffer is empty or the telescope-presence check fails.
  14. magicRecentExceptionsEnrichermagicRecentExceptions: HttpException at api.dart:142,... for up to 3 most recent exception records. Each entry surfaces the type plus the file:line extracted from the first stack frame. Null when the telescope buffer is empty or the telescope-presence check fails.

All fourteen enrichers are synchronous, return null on miss, and never retain the Element across calls (oracle finding #3 contract, see DuskSnapshotEnricher).

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

isInstalled bool
Whether install has been called at least once.
no setter

Static Methods

install() → void
Idempotent install. Safe to call multiple times within the same isolate lifetime (matches DuskPlugin.install semantics).
resetForTesting() → void
Test-only reset. Drops all fourteen enrichers from DuskPlugin.enrichers, cancels the Echo connection-state subscription, and clears the idempotency guard.