Instalacija

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

Jedna zavisnost

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

API sa prioritetom stanja

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

Postepeno usvajanje

Krenite od jednog toka funkcionalnosti i migrirajte ekran po ekran.

Instaliraj i inicijalizuj

Koristite pub add, zatim povežite početno root stanje za stranice i overlay.

Command

Početno stanje aplikacije

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

Unutar jednog stacka, PageEntry.key mora ostati jedinstven jer tada postaje identitet Navigator stranice.