route in flutter code example
Example 1: flutter navigate to new screen
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondRoute()),
);
}
Example 2: routes in flutter
routes in flutter
Example 3: routes in flutter
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondRoute()),
);
Example 4: material app routes
MaterialApp(
initialRoute: '/',
routes: {
'/': (context) => FirstScreen(),
'/second': (context) => SecondScreen(),
},
);
Example 5: page routing flutter
Page Navigation in flutter