flutter routes management code example
Example 1: named routes flutter
MaterialApp(
routes: {
'/':(context)=>HomePage(),
'/meals':(context)=>MealsPage(),
'/orders':(context)=>Orders(),
},
);
Example 2: routes in flutter
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondRoute()),
);