I am a recent flutter developer. How can i get current route name?I am having a common list view in two different routes. I want to hide certain properties in list based on routes.
Please help me..
try this:
var route = ModalRoute.of(context);
if(route!=null){
print(route.settings.name);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With