jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.34k stars 1.62k forks source link

Get routing still not working in version 4.6.6 #2918

Open CarlosBernalA opened 1 year ago

CarlosBernalA commented 1 year ago

When navigating to a route with Get.toName takes you to the route correctly, but when leaving the route with Get.Back or any other means the state of the route remains and when entering the route again it remains with the previous state, The Controller continues with the same state as the previous one, it does not die at any time, it is still in memory.

A few months ago I was forced to make some modifications to the get code, temporarily while another version comes out, but the modification was simple but I am not sure it is the correct change. The change I made was to the router_observer.dart file in the didPop event. Below I attach a screenshot, maybe it will help: Codigo

Getx Version: get: ^4.6.6

CarlosBernalA commented 1 year ago

Note that this modification partially solved the problem.

mohsinnaqvi606 commented 1 year ago

@jonataslaw , @CarlosBernalA This issue only exist in unNamed routing. I tried Named routing and it's working properly

Define route like this in GetMaterialApp

initialRoute: '/',
      getPages: [
        GetPage(name: '/', page: () => Splash()),
      ],

Where you want to navigation write this code Get.offNamed('/'); OR Get.toNamed('/');

CarlosBernalA commented 1 year ago

@mohsinnaqvi606 Even so, the problem persists, this happened after updating Flutter to version 3, before that there was no problem, I attach images of the initialization of the routung of my app. image image

When calling Get.back() or another back method it only shows this message in the console, before it eliminated memory image

mohsinnaqvi0606 commented 1 year ago

@mohsinnaqvi606 Even so, the problem persists, this happened after updating Flutter to version 3, before that there was no problem, I attach images of the initialization of the routung of my app. image image

When calling Get.back() or another back method it only shows this message in the console, before it eliminated memory image

@CarlosBernalA Yes, you are right. It's working only in few cases. It's hard to understand, what is the cause of issue. My suggested solution worked in one project. but it's still not working in other project

mario987111 commented 1 year ago

You're right. I had the same problem

KamalBalah commented 1 year ago

same issue