juniorFlutter
How do you navigate between screens (routes)?
Updated Apr 28, 2026
Short answer
By using the Navigator class, which manages a stack of Route objects using push and pop methods.
Deep explanation
In basic navigation (Navigator 1.0), you use Navigator.push() to add a new screen to the stack, and Navigator.pop() to remove it and go back. Screens in Flutter are called Routes, typically wrapped in MaterialPageRoute to provide platform-specific transition animations.
Real-world example
Clicking a product card in a list to navigate to the product detail screen, and then tapping the back button to return.
Common mistakes
- Pushing the same screen multiple times onto the stack instead of replacing it, causing deep, memory-heavy route stacks.
Follow-up questions
- What is Navigator.pushReplacement?
- How do you pass data back to the previous screen?