નેવિગેશન 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
