You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using navigateNamed to navigate a page with route parameters, the route arguments cannot be accessed inside didPush method of the AutoRouterObserver. While the arguments are correctly being passed to the page, they are not accessible inside the observer.
Main:
import 'package:auto_router_test/app_router.dart';
import 'package:auto_router_test/routing_observer.dart';
import 'package:flutter/material.dart';
void main() {
runApp(App());
}
class App extends StatelessWidget {
// make sure you don't initiate your router
// inside of the build function.
final _appRouter = AppRouter();
App({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: _appRouter.config(
navigatorObservers: () => [RoutingObserver()],
));
}
}
When using
navigateNamed
to navigate a page with route parameters, the route arguments cannot be accessed inside didPush method of the AutoRouterObserver. While the arguments are correctly being passed to the page, they are not accessible inside the observer.Main:
Observer:
Output: flutter: did push: null
The text was updated successfully, but these errors were encountered: