I am working on an app and id like to ask if anyone can help me to understand how using routes I can navigate from my current screen to another page based on the previous page I navigated from. I can navigate to the page through different routes and I want to navigate to separate pages based on my previous routes
I tried using naming the routes in my MainDart and use this bool _isfromreservation = ModalRoute.of(context)!.settings.name == 'reservation'; and add it to the button with an if statement conditioning if this is true.
Hopefully this code help you ..please check this