Routing¶
flueco_core provides a small Router contract (pushWidget, pushPage, and pop) and a NavigatorKeyProvider. flueco_auto_route implements both using AutoRoute while also exposing AutoRoute's own API for features that need route declarations or router-specific behavior.
Connect a root router¶
Create the generated AutoRoute root router as described by AutoRoute, register that instance under RootStackRouter, then include AutoRouteServiceProvider in Flueco's provider set:
final appRouter = AppRouter(); // Generated by your AutoRoute setup.
container.singleton<RootStackRouter>((_) => appRouter);
providers.add(AutoRouteServiceProvider());
This is a composition fragment; the provider declares the RootStackRouter prerequisite and exposes Flueco's Router, NavigatorKeyProvider, and root-router provider APIs. Do not create a second router instance for components that must share the same navigation stack.
The app-facing ToastService and DialogService also use NavigatorKeyProvider to find the active navigator. When using those services, make sure the selected navigator is mounted and is the intended root. AutoRoute annotations and APIs are re-exported by flueco_auto_route; consult AutoRoute's documentation for its route-generation workflow, then use the flueco_auto_route reference for the adapter surface.