-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get 5.0.0 Nested Navigation duplicate routes #3111
Comments
I have been studying GetX's Nav2 for some time. |
However, in your example, you only need to remove the |
Hello! I tried to remove |
Are you referring to the default AppBar not showing the back button? AppBar(
leading: RouterListener(builder: (context) {
final delegate = context.delegate;
if (delegate.canBack) {
return BackButton(
onPressed: () {
delegate.back();
},
);
} else {
return const DrawerButton();
}
}),
title: RouterListener(builder: (context) {
final title = context.location;
return Text(title);
}),
centerTitle: true,
) |
Now you can refer to my sample code, which has implemented page state preservation. |
ATTENTION: DO NOT USE THIS FIELD TO ASK SUPPORT QUESTIONS. USE THE PLATFORM CHANNELS FOR THIS. THIS SPACE IS DEDICATED ONLY FOR BUGS DESCRIPTION.
Fill in the template. Issues that do not respect the model will be closed.
Describe the bug
Hello! In my app I use Nested Navigation, like described in nav 2 example. My application has a path home which contains 2 sub paths, orders and profile. The orders page also has an internal page with a description of the order. This is implemented using Nested navigation. When I'm on the order description screen, I try to open the settings page on top of the stack, which is on the same level as home. The settings page opens on top, but I noticed that in the DevTools inspector the settings page is duplicated twice. Why does this happen, and how to get rid of the double?
Reproduction code
NOTE: THIS IS MANDATORY, IF YOUR ISSUE DOES NOT CONTAIN IT, IT WILL BE CLOSED PRELIMINARY)
Full code https://github.com/egortabula/get_nested_navigation_test
My Routes
Pages
Home View with Nested Navigation
Orders View
Order Details View
To Reproduce
Steps to reproduce the behavior:
4, Settings View is duplicated twice
Expected behavior
It seems to me that pages should not be duplicated. I checked the same example in GoRouter, there are no duplicate pages. But maybe I don't understand something?
Screenshots
![Screenshot 2024-05-26 at 17 17 10](https://private-user-images.githubusercontent.com/64892468/333885981-7e3de29b-a840-40bf-9df6-e791454173eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NTY1NzEsIm5iZiI6MTcxOTY1NjI3MSwicGF0aCI6Ii82NDg5MjQ2OC8zMzM4ODU5ODEtN2UzZGUyOWItYTg0MC00MGJmLTlkZjYtZTc5MTQ1NDE3M2ViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDEwMTc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNiYzExYWJhMzA0YTMxMjU4OGQzNDNkZmQwMzA5MTg4YTZlODVjNTc0YzE2NjMxNDA4YzE5ZGU3OWJkODY4OTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.bOKf-IVsai17U-IHCL7x-1Purlz2H4Zkiww04Phl3fM)
![Screenshot 2024-05-26 at 17 18 44](https://private-user-images.githubusercontent.com/64892468/333885985-0a752819-8eeb-4f62-a450-6ea6b006330c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk2NTY1NzEsIm5iZiI6MTcxOTY1NjI3MSwicGF0aCI6Ii82NDg5MjQ2OC8zMzM4ODU5ODUtMGE3NTI4MTktOGVlYi00ZjYyLWE0NTAtNmVhNmIwMDYzMzBjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI5VDEwMTc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA1YjIzNWIwOGE0YTdhODg1NjVjMGVkODg3OTg2ZDhkZDZlYjBhYjI0ZmYyMzM3NGY2MTVjMDlkMTU0NzgzOGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.7wk7Z2T5D76SII_ualXswBv4Myo2o5P6Gr8S3jDXPkc)
Flutter Version:
5.22.1
Getx Version:
6.0.0 release-candidate-6
Describe on which device you found the bug:
IOS Simulator.15 Pro
Minimal reproduce code
Full code https://github.com/egortabula/get_nested_navigation_test
The text was updated successfully, but these errors were encountered: