Lets say that there is a way to enter the same screen from different places:
home screen -> final screen
second screen -> final screen
third screen -> final screen
etc...
how can I know from which screen I entered from? Because I need to make my own back button (default back button doesn't reset the state of the previous screen, and the state needs to reset ) I can't seem to find the example for the problem.
Can you use if statement for that?
Also I'm using GetX package
Desired outcome:
home screen -> final screen (back button)-> home screen
second screen -> final screen (back button)-> second screen
third screen -> final screen (back button)-> third screen