Member-only story
Flutter App: Navigation & Routing
Routing from one screen to the other is simple in a mobile application. Every mobile development framework has a unique way of addressing this.
In a Flutter app, this is achieved in three ways:
- Dynamic Routing
- Static Routing
- Generated Route technique
Let me explain each of the above with the help of an example.
Dynamic Routing
In dynamic routing, Navigator’s push method is used to get a user from one screen to another. A developer must provide the content and route parameters when using this method. The syntax needed to push a user to the new screen using dynamic routing in Flutter is below:
Navigator.push(context,MaterialPageRoute(builder: (context) => PageToLoad()),);
Static Routing
When using static routing in a Flutter app, a developer configures the routes in the MaterialApp widget. He/she must provide the initial route in the Flutter app:
MaterialApp(