Navigation என்பது Flutter இல் screens (pages/routes) க்கு இடையே நகர்வது — Navigator (routes இன் stack) ஐ பயன்படுத்தி அடிப்படை navigation க்காக, அல்லது மிகவும் சிக்கலான apps க்கு declarative routing packages ஐ பயன்படுத்தி. Navigation ஐ புரிந்துகொள்வது multi-screen apps ஐ உருவாக்க முக்கியமாகும்.
Navigator உடன் அடிப்படை navigation (ஒரு stack)
// the Navigator manages a STACK of routes (screens)
// PUSH a new screen onto the stack (navigate to it)
Navigator.push(
context,
MaterialPageRoute(builder: (context) => SecondScreen()),
);
// POP — go back (remove the top screen, return to the previous)
Navigator.pop(context);
Think of navigation as a STACK of screens:
→ PUSH adds a screen on top (navigate forward)
→ POP removes the top screen (go back)
→ the back button / gesture also pops
