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):
- magicFormEnricher —
magicFormField: <name>for elements backed by aMagicFormDatatext controller. - magicNavigationEnricher —
magicRoute: <currentLocation>for every element when the router has resolved a route. - magicControllerEnricher —
magicControllerState: <Class>.<status>for the first registeredMagicStateMixincontroller. - magicFormErrorsEnricher —
magicFormErrors: <field>="<text>",...for elements under aMagicFormwhose controller carries server-sideValidatesRequestserrors matching the form's fields. Per-field error text is quoted and truncated to 80 chars (...-suffixed). - magicGateResultEnricher —
magicGateResult: <ability>.<allowed|denied>for the most recently cachedGateResultinGate.manager. - magicMiddlewareEnricher —
magicMiddleware: <name1,name2>for the active route's middlewares viaMagicRouter.currentRoute. - magicAuthUserEnricher —
magicAuthUser: <id>[:<displayName>]for the authenticated user surfaced byAuth.user. - magicControllerFlagsEnricher —
magicControllerFlags: <Class>.isLoading=<bool>,isSuccess=<bool>,isError=<bool>,isEmpty=<bool>for the first registeredMagicStateMixincontroller. - magicRouteParamsEnricher —
magicRouteParams: <k>=<v>,...for the active route's path + query parameters (path params first). - magicEchoConnectionEnricher —
magicEchoConnection: connected|reconnecting|disconnectedfor the current broadcast connection state. Null when the broadcasting provider is not registered. - magicGateResultsAllEnricher —
magicGateResultsAll: <ability>=<allowed|denied>,...for up to 5 most recently checked abilities. Null when no ability has been checked yet. - magicRecentHttpEnricher —
magicRecentHttp: 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. - magicRecentLogsEnricher —
magicRecentLogs: [WARN] msg,[ERROR] msgfor 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. - magicRecentExceptionsEnricher —
magicRecentExceptions: 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.installsemantics). -
resetForTesting(
) → void -
Test-only reset. Drops all fourteen enrichers from
DuskPlugin.enrichers, cancels the Echo connection-state subscription, and clears the idempotency guard.