Closed shazebK closed 2 years ago
This seems a genuine bug. :thinking: Please let me know how you are going to fix this bug, before I assign it to you.
I am thinking if , In navigation-bar.dart we can check if index of page does not matches with the current page index then only we have to push that page.
Yes, that seems a plausible fix to me. Although we also have to consider one scenario, say the user navigates from home to post_feed, then to chat screen, then profile screen, and again clicks on chat_screen. We are pushing new widgets again and again onto the stack, which compromises the performance of the app. I was wondering if we should solve this issue alongside as well, what do you think?
Yes you are right.
What if clicking on back button it directly takes us to homepage only.
Because we already have bottom navigation bar to navigate to required pages,
Yes, that would be ideal. And when the different icon is clicked, we use pushReplacement to navigate. We will need to take care of the home screen though, because that should not be replaced. For that case, we may use simple push() to put the next page on top of the home-screen
I guess, we will have to use popUntil() for going back to Home page, when the back button is pressed.
Yeah works fine with me.
Okay, so with the bug being properly discussed, and an idea formulated, I am assigning this issue to you to resolve.
Ok I will keep these things in mind.
As per the documentation, popUntil() requires the route name, and since we haven't yet implemented Named Routing in our application, this won't be possible as of now. So, we'll deal with that in an upcoming issue. For now, please try to fix the bug the way we had initially discussed.
Yes we can use pushReplacement and directly pushing the home page on pressing the back button
Current page get pushed on itself on clicking that page icon in Bottom Navigation bar, thus clicking back button does opens up the previous page, this is a bug and need fixing. I can fix this bug So I request you to assign this issue to me.
https://user-images.githubusercontent.com/106864146/195773640-fe257f6e-4297-4695-92ce-6f72ef39e61d.mp4