auto_route_devtools 0.2.0
auto_route_devtools: ^0.2.0 copied to clipboard
auto_route adapter for the navigation_devtools DevTools extension — live backstack, router tree, args, and interactive navigation for auto_route apps.
auto_route_devtools #
auto_route (v11) adapter for the navigation_devtools DevTools panel: live backstack across nested routers, the full static router tree with guard badges, path/query params and args previews, and confirm-gated navigatePath/pop from the panel.
Setup #
import 'package:auto_route_devtools/auto_route_devtools.dart';
void main() {
final router = AppRouter();
AutoRouteDevTools.init(router);
runApp(MaterialApp.router(
routerConfig: router.config(
navigatorObservers: () => [AutoRouteDevTools.navigationObserver()],
),
));
}
Run your app and open the navigation_devtools tab in Flutter DevTools.
Prefer the adapter API directly? AutoRouteDevTools is a thin facade over it:
final adapter = AutoRouteAdapter(router);
NavigationDevTools.register(adapter);
// observers: () => [adapter.observer]
Migrating from 0.0.x #
- Your
AutoRouteDevTools.init(...)/navigationObserver()wiring keeps working unchanged. - The DevTools tab is now called navigation_devtools (the panel moved into the shared core package and also supports Navigator 1.0, custom
RouterDelegates, and go_router).
Dialogs & bottom sheets #
showDialog/showModalBottomSheet are pageless routes on the raw Navigator — auto_route's stack never includes them. To see them in the panel, pair the adapter with a Navigator1Adapter observer:
final pageless = Navigator1Adapter(label: 'Pageless routes');
NavigationDevTools.register(pageless);
// in your router config:
navigatorObservers: () => [AutoRouteDevTools.navigationObserver(), pageless.observer],
Prior art #
- auto_route ships no DevTools extension (as of v11);
developer_tools_auto_routeis an in-app overlay, not a DevTools panel.
Known limitations #
- Route args are arbitrary objects — shown as
runtimeType+toString()preview. - Push-by-name is not supported (path-based navigation only).
- Registration is a hard no-op under
kReleaseMode.