Device back button has different result rather than getx toNamed - flutter

I have two screen, first is for load list off all shop data and second is the detail screen of the shop. When I'm in second page and go back with arrow icon with Get.toNamed the first screen will load all list again but when I in the second page and I go back with my device back button in the first page it just showing loader icon and the list not loading. Can someone help me why it can be happen ?

Use Get.off() or follow this article.

Related

Flutter Get Navigation - Removing route in the middle

I know there are some duplicate/similar questions, I read them all but I can't get the right answer.
I'm using Getx to navigate between screens(Get.toNamed()) and I was just wondering if there's any way to remove a certain route from the navigation stack. Let's say I have the following routing for my sample social networking app:
main screen -> post screen -> profile screen -> (another) post screen
I want to remove the first post screen and add a new post screen after the profile screen but able to go back to the profile screen when I press the back button from the second post screen(another back button goes to the main screen and if I go to profile screen(again) from the second post screen, the first profile screen will also be removed). The reason I want to do this is because I want the screens to have only one instance.
I tried saving the Get.rawRoute of post screen and called Get.removeRoute(route) when opening the second post screen from the profile screen but I get "'route._navigator == this': is not true." assertion.
Is it impossible because it's a stack? but.... I just don't think this is impossible, there must be a way...
Help me Flutter Masters!
Just kidding, saving the Get.rawRoute of the post screen and calling Get.removeRoute(route) before opening another post screen works just fine, I made a mistake. HAHAHAHAHAHAHA

Why does Flutter show another page in the stack before showing the actual page on Back event

I have built a functioning flutter app using Navigator 2.0 API and RouterDelegate. All the navigation works fine but the problem is on the back event. On pressing back either from the app bar or from the device button, the top page does pop but the page that is 2 layers deep in the stack is displayed for a fraction of second before the desired page is displayed.
Like in the attached image, when going back from ArchivedChatThread, Bots is displayed for few milliseconds and then another page is shown. Here, the stack is also not proper as there should be one page between Bots and ArchivedChatThread i.e ArchivedChats.
I tried a lot of different things but am unable to find a solution as this is my first flutter app and Navigator 2.0 being a relatively new and complex concept.
image
Any kind of help is appreciated. Thanks!

popAndReplacement shows page which is behind the poping page in Flutter

There are 3 screens in my app. When I use popAndPushNamed() in the 2nd page, it pops the 2nd page and shows the 3rd page, but when It pops it shows the 1st page behind it in milliseconds. how to avoid that?
is Animation the way?
or are there any other methods just like push and show 3rd page, and pop 2nd page when the 3rd page visible to the user?
popAndPushNamed() as the documentation suggests, pushes the new route but pops the old route simultaneously, and hence, there is a small moment where you can see the first page even if your new routes are fully opaque. Replace the method with Navigator.of(context).pushReplacementNamed() and it should work as expected.

How to pass data from one view to another when I use SideMenu

I have a side menu. In my Home screen, I am getting data. but when I select the side menu and again opening Home screen.I lost my data in Home Screen.I am using viewwillapper method but it doesn't work.Please tell me how to solve this problem.

Ionic either doesn't show back button or page doesn't load at all

I am trying to create a new page from an existing page with a back button. I have recreated the issue here in a plunkr. In the trip analytics option When I click the first card i.e. Enter Home address. I want the todayDetail .html page to come up with a back button. I have already tried two approaches
First approach The ng-click approach. In which I give $state.go(statename) to give that page. But then I wouldn't get a back button as the navigation stack is changed.
Second approach - If I keep the navigation stack i.e. keep the state name as initial.trips.today.todayDetail. The page doesn't load at all.
What is the issue? How should I go about it?