O'rnatish

Add the package, then move navigation and overlays into explicit state. Keep imperative push/pop out of the same stack.

Bitta bog'liqlik

Install with one pub command. No code generation setup is required.

Holatga tayangan API

You control a List<PageEntry> and optional OverlayRequest as pure state.

Bosqichma-bosqich joriy etish

Bitta funksional oqimdan boshlang va ekranma-ekran ko'chiring.

O'rnatish va boshlang'ich sozlash

pub add dan foydalaning, so'ng sahifalar va overlay uchun boshlang'ich ildiz holatini ulang.

Buyruq

Ilovaning boshlang'ich holati

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'),
    ];
  }
}
Cheklov

Bitta stek ichida, PageEntry.key must stay unique chunki u Navigator sahifasining identifikatoriga aylanadi.