ການຕິດຕັ້ງ
Add the package, then move navigation and overlays into explicit state. Keep imperative push/pop out of the same stack.
ພຶ່ງພາພຽງອັນດຽວ
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, ແລ້ວຕໍ່ສາຍສະຖານະຮາກເລີ່ມຕົ້ນສຳລັບໜ້າ ແລະໜ້າຊ້ອນ.
Command
ສະຖານະແອັບເລີ່ມຕົ້ນ
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'),
];
}
}
Constraint
ພາຍໃນ stack ດຽວ, PageEntry.key ຕ້ອງບໍ່ຊ້ຳ ເພາະມັນກາຍເປັນຕົວຕົນຂອງໜ້າ Navigator.
ກ່ອນໜ້າ
ບົດນໍາຕໍ່ໄປ
ໜ້າເປັນຂໍ້ມູນ