Navigation Flutter मा स्क्रिनहरू (pages/routes) बीच सर्छ — Navigator (routes को stack) को प्रयोग गरेर आधारभूत navigation को लागि, वा अधिक जटिल अनुप्रयोगहरूको लागि declarative routing packages को प्रयोग गरेर। Navigation बुझ्नु multi-screen अनुप्रयोगहरू निर्माण गर्नको लागि आवश्यक हो।
Navigator (एक stack) सँग आधारभूत navigation
// 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
