name route flutter code example
Example 1: named routes flutter
MaterialApp(
routes: {
'/':(context)=>HomePage(),
'/meals':(context)=>MealsPage(),
'/orders':(context)=>Orders(),
},
);
Example 2: How to get the current route name in flutter
ModalRoute.of(context).settings.name