Flutter & Dart |21- How to Navigation or Switch between Screens- Note App-Part 3 | Googles Framework

Опубликовано: 14 Март 2026
на канале: Tech Now Tv
427
10

In this videos we ave explicitly explained navigation and routes in flutter development and is a continuation of our note keeping app in the making.

We can navigate page/screen by Navigator.push method and Navigator.pop method.
In order to navigate from FirstScreen to SecondScreen on RaisedButton pressed event then, we would need to write Navigot.push code in the build method of FirstScreen inside onPressed event of RaisedButton
Navigator.push method pushes the given route onto the stack of routes which is maintained by Navigator class.
Now to get this route, we can use MaterialPageRoute or we can create our own route.
To push a new route on the stack, we can create an instance of MaterialPageRoute with a builder function that creates a widget that you want to show on the screen.
second context , context SecondScreen is the context of SecondScreen.