DuskNavigateAdapter typedef
Optional consumer-side hook that ext.dusk.navigate consults before
falling back to SystemNavigator.routeInformationUpdated.
Hosts that own a router with a non-default RouteInformationProvider (GoRouter wired through Magic / MagicRoute, auto_route with custom parser) register an adapter so dusk pushes through the host router's public API instead of broadcasting a platform message the delegate may not be listening to.
Contract:
- Return
truewhen the route was accepted and the active router has begun the navigation. Returnfalsewhen the adapter cannot handle the request so dusk falls back to the platform broadcast. - Throw to surface an adapter-internal failure; dusk swallows the
throw (logs to
duskdeveloper log) and still falls back. - The adapter MUST NOT block on long-running async work. Push the
route synchronously (or with a single
awaiton the router's public push API) and return.
Implementation
typedef DuskNavigateAdapter = Future<bool> Function(String route);