నావిగేషన్ Flutter లో స్క్రీన్ల మధ్య (పేజీలు/రూట్లు) కదలిక — ప్రాథమిక నావిగేషన్ కోసం Navigator (రూట్ల స్టాక్) ను ఉపయోగించడం, లేదా మరింత సంక్లిష్ట అనువర్తనాల కోసం డిక్లరేటివ్ రౌటింగ్ ప్యాకేజీలను ఉపయోగించడం. నావిగేషన్ను అర్థం చేసుకోవడం బహుళ-స్క్రీన్ అనువర్తనాలను నిర్మించడానికి అవసరం.
Navigator తో ప్రాథమిక నావిగేషన్ (ఒక స్టాక్)
// 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
