
ASSIGNMENT 4
Deepmalika Das/T11/21
AIM:
To apply navigation and routing in Flutter Apps.
LO: LO2 mapped
THEORY:
Navigation and routing are essential concepts in mobile application development, as
they allow users to move between different screens (pages) within an app. In Flutter,
navigation is managed using a built-in system that enables smooth transitions between
multiple screens while maintaining the app’s structure and user experience.
In Flutter, each screen is represented as a widget, typically a StatelessWidget or
StatefulWidget. Navigation refers to the process of moving from one screen to
another, while routing defines how these screens are organized and accessed within the
application.
Flutter uses a Navigator widget to manage a stack of routes. A route represents a
screen in the application. The Navigator works like a stack data structure, where new
screens are pushed onto the stack and removed when the user navigates back.
There are two main types of routing in Flutter:
1. Static (Named) Routing
In named routing, each screen is assigned a unique route name. These routes are
defined in the application, and navigation is performed using these predefined names.
This approach improves code readability and makes it easier to manage multiple
screens in larger applications.
2. Dynamic Routing
In dynamic routing, screens are navigated directly without predefined names. Instead,
the destination screen is specified during navigation. This approach is simple and useful
for smaller applications or when passing data between screens.
Navigation between screens typically involves two main actions:
● Push Navigation: A new screen is opened and added to the navigation stack.