dusk library
Magic ↔ fluttersdk_dusk integration adapter barrel.
Import this file when your app uses both magic and fluttersdk_dusk and wants the MagicDuskIntegration enrichers wired into DuskPlugin. Consumers MUST add magic_devtools as a dev_dependency; it depends on magic and fluttersdk_dusk, so transitive resolution does not happen through magic itself.
Host integration (debug-only in lib/main.dart). MagicDuskIntegration
MUST run AFTER Magic.init() because its enrichers query
Magic.find<X>() for form / nav / controller state. DuskPlugin
itself installs BEFORE Magic.init() so the snapshot pipeline is
live during Magic boot:
if (kDebugMode) {
DuskPlugin.install();
}
await Magic.init(configFactories: [...]);
if (kDebugMode) {
MagicDuskIntegration.install();
}
See src/dusk_integration.dart for the concrete MagicDuskIntegration
class and 14 enrichers.
Classes
- MagicDuskIntegration
- Glues magic's primitives (MagicForm, MagicRouter, Gate, Auth, Echo) into the fluttersdk_dusk snapshot pipeline.
Functions
-
magicAuthUserEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicAuthUser: <id>[:<displayName>]for the authenticated user. -
magicControllerEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicControllerState: <ControllerClass>.<rxStatus>for the firstMagicStateMixin-bearing controller registered viaMagic.put. -
magicControllerFlagsEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicControllerFlags: <Class>.isLoading=<bool>,isSuccess=<bool>,isError=<bool>,isEmpty=<bool>for the first registeredMagicStateMixincontroller inMagic.controllers. -
magicEchoConnectionEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicEchoConnection: connected|reconnecting|disconnectedfor the current broadcast connection state. -
magicFormEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicFormField: <name>whenelementis backed by a TextEditingController owned by aMagicFormDatain an ancestorMagicForm. -
magicFormErrorsEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicFormErrors: <field>="<text>",...for elements under aMagicFormwhose controller carries server-sideValidatesRequestserrors matching the form's own field set. -
magicGateResultEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicGateResult: <ability>.<allowed|denied>for the most recently cachedGateResultinGate.manager. -
magicGateResultsAllEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicGateResultsAll: <ability>=<allowed|denied>,...for up to 5 of the most recently checked Gate abilities. -
magicMiddlewareEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicMiddleware: <name1,name2>for the active route's resolved middleware names. -
Enricher: emits
magicRoute: <currentLocation>when the router has a resolved location. -
magicRecentExceptionsEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicRecentExceptions: <Type> at <file.dart>:<line>,...for up to 3 most recent records inTelescopeStore.recentExceptions. -
magicRecentHttpEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicRecentHttp: <METHOD> <url> <status> <durationMs>ms,...for up to 5 most recent records inTelescopeStore.recentHttp. -
magicRecentLogsEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicRecentLogs: [<shortLevel>] <message>,...for up to 3 most recent log records at or above WARNING level inTelescopeStore.recentLogs. -
magicRouteParamsEnricher(
Element element, RefRegistry refs) → String? -
Enricher: emits
magicRouteParams: <k>=<v>,...for the active route's path parameters followed by its query parameters.