Named Routes ဆိုတာ screen တွေကို string name နဲ့မှတ်ထားတဲ့ navigation နည်းလမ်းပါ။ Page အနည်းငယ်ပဲရှိတဲ့ project မှာ direct MaterialPageRoute ကရိုးရှင်းပေမဲ့ route များလာရင် '/profile', '/settings', '/details' ဆိုပြီး central place တစ်ခုမှာသတ်မှတ်ထားတာ ပိုရှင်းပါတယ်။
dart
MaterialApp(
initialRoute: '/',
routes: {
'/': (context) => const HomeScreen(),
'/details': (context) => const DetailScreen(),
'/settings': (context) => const SettingsScreen(),
},
);
// Navigate to settings
Navigator.pushNamed(context, '/settings');
// Go back
Navigator.pop(context);You should see
Navigator.pushNamed(context, '/settings') ခေါ်လိုက်ရင် SettingsScreen ပေါ်လာပါမယ်။နောက်တစ်ဆင့်
Navigation ပြီးရင် app ထဲမှာ image/file အသုံးပြုဖို့ Assets lesson ကိုဆက်ဖတ်ပါ။