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 first MagicStateMixin-bearing controller registered via Magic.put.
magicControllerFlagsEnricher(Element element, RefRegistry refs) String?
Enricher: emits magicControllerFlags: <Class>.isLoading=<bool>,isSuccess=<bool>,isError=<bool>,isEmpty=<bool> for the first registered MagicStateMixin controller in Magic.controllers.
magicEchoConnectionEnricher(Element element, RefRegistry refs) String?
Enricher: emits magicEchoConnection: connected|reconnecting|disconnected for the current broadcast connection state.
magicFormEnricher(Element element, RefRegistry refs) String?
Enricher: emits magicFormField: <name> when element is backed by a TextEditingController owned by a MagicFormData in an ancestor MagicForm.
magicFormErrorsEnricher(Element element, RefRegistry refs) String?
Enricher: emits magicFormErrors: <field>="<text>",... for elements under a MagicForm whose controller carries server-side ValidatesRequests errors matching the form's own field set.
magicGateResultEnricher(Element element, RefRegistry refs) String?
Enricher: emits magicGateResult: <ability>.<allowed|denied> for the most recently cached GateResult in Gate.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.
magicNavigationEnricher(Element element, RefRegistry refs) String?
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 in TelescopeStore.recentExceptions.
magicRecentHttpEnricher(Element element, RefRegistry refs) String?
Enricher: emits magicRecentHttp: <METHOD> <url> <status> <durationMs>ms,... for up to 5 most recent records in TelescopeStore.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 in TelescopeStore.recentLogs.
magicRouteParamsEnricher(Element element, RefRegistry refs) String?
Enricher: emits magicRouteParams: <k>=<v>,... for the active route's path parameters followed by its query parameters.