How to return the existing (current) route from go_router? How to return the existing (current) route from go_router? this worked for me final currentRoute = ModalRoute of(context)! settings name!; I faced a similar requirement In your casem you want to use a redirect when your condition is false
go_router | Flutter package - Pub A declarative routing package for Flutter that uses the Router API to provide a convenient, url-based API for navigating between different screens You can define URL patterns, navigate using a URL, handle deep links, and a number of other navigation-related scenarios
flutter - Go_router current route queryParams - Stack Overflow GoRouter of(context) location gives us the current route path such as product 10110 but I'd like to know how to also get the current route queryParams in a similar fashion (outside of the GoRoute builder)