I am developing a Flutter app for iOS, Android, and Web. I decided to use the GetX package because it makes things much easier, but I am stumped on how to handle Web URL/address bar navigation. For example, one of my screens shows details about an event. Navigating there through the app works fine, but what if I paste in a link to the event in the browser? My GetX EventController manages a _selectedEvent
event which is how I know which event to display the details for. However, if I use a URL link, my _selectedEvent
event is never updated and the details screen won't show the correct event.
Currently I set _selectedEvent
in my homepage when the user clicks on the event to navigate to the details screen. However, if the user navigates through the address bar in a browser, I cannot update _selectedEvent
. I don't think I can use any of the state managers in GetX because I am not updating widgets, so I am not sure where to update my _selectedEvent
.
How should I handle address bar navigation?
Hopefully my explanation makes sense. I am still trying to learn Flutter.