gurleensethi / sailor

Easy page navigation and management in Flutter apps.
https://pub.dev/packages/sailor
MIT License
145 stars 24 forks source link

Get current route (entire route object or just name) #42

Open b-asaf opened 4 years ago

b-asaf commented 4 years ago

Hi, First let me say that this is a great package.

I am trying to get the current route in order to perform a specific action. Is there a way to get the current route - something like Routes.sailor.currentRouteName or Routes.sailor.currentRoute.

I came up with 2 possible options, if there is another way please let me know:

  1. Maybe use the 'SailorLoggingObserver` (like its suggested in issue #32 ) but I am not sure this is the correct approach?
  2. The option I am using now is ModalRoute.of(context).isCurrent but I am guessing navigation package like Sailor should have something build in, no?

Thanks