नेव्हिगेशन 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
