انسٹالیشن
Add the package, then move navigation and overlays into explicit state. Keep imperative push/pop out of the same stack.
ایک dependency
Install with one pub command. No code generation setup is required.
حالت پر مبنی API
You control a List<PageEntry> and optional OverlayRequest as pure state.
تدریجی اپنانا
ایک feature flow سے شروع کریں اور اسکرین بہ اسکرین منتقل کریں۔
انسٹال اور ابتدائی سیٹ اپ
pub add استعمال کریں، پھر pages اور overlay کے لیے ابتدائی root state جوڑیں۔
Command
Initial App State
import 'package:declarative_nav/declarative_nav.dart';
class _AppRootState extends State<AppRoot> {
OverlayRequest? _overlay;
late List<PageEntry> _pages;
@override
void initState() {
super.initState();
_pages = const [
PageEntry(key: 'home', name: '/home'),
];
}
}
پابندی
ایک stack کے اندر، PageEntry.key منفرد رہنا چاہیے کیونکہ یہی Navigator page identity بن جاتا ہے۔
پچھلا
Introductionاگلا
Pages and Resolver