Instalimi

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

Një varësi e vetme

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

API e orientuar nga gjendja

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

Adoptim gradual

Fillo me një rrjedhë funksionale dhe migro ekran pas ekrani.

Instalo dhe inicializo

Përdor pub add, pastaj lidh gjendjen fillestare rrënjë për faqet dhe mbivendosjen.

Komanda

Gjendja fillestare e aplikacionit

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

Brenda një liste, PageEntry.key duhet të mbetet unik sepse bëhet identiteti i faqes në Navigator.

E mëparshmja

Hyrja