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.removed Returns No Value After Using Get.back() #2936

Open irayshi opened 1 year ago

irayshi commented 1 year ago

Issue: Get.routing.removed Returns No Value After Using Get.back()

Description: I encountered a bug where Get.routing.removed does not return any value even after I used Get.back() on another page.

Steps to Reproduce:

  1. Navigate to a page, let's call it Page A.
  2. From Page A, use Get.to() to navigate to another page, Page B.
  3. On Page B, use Get.back() to return to Page A.
  4. On Page A, print Get.routing.removed.

Expected Behavior: I expected Get.routing.removed to return the route of the previously removed page, which should be the route of Page B.

Actual Behavior: Get.routing.removed does not return any value, and it remains empty.

Environment:

Pursoth1815 commented 1 year ago

This is because Get.back() simply pops the current route (Page B) and returns to the previous route (Page A) without removing it from the stack. Get.routing.removed is typically used when you use methods like Get.off() or Get.offAll() to remove and replace routes in the stack. In your case, since you're not removing Page A from the stack, there are no removed routes to display.