Skip to content
pubscout

app_state

0.9.7, released 8 months ago by ainkin.com

Stateful navigation stack built on Flutter's Router API

WASM-ready
$ flutter pub add app_state
Source repository

What it does

Provides a type‑safe, state‑first navigation system that keeps page states alive, supports deep‑linking, and recovers the stack from URLs.

AI-written summary of version 0.9.7, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Large apps with complex navigation and state that needs to survive rebuilds
  • Projects that require compile‑time type safety for push/pop operations
  • Apps that need URL‑based stack recovery for web and deep linking

Skip it when

  • Small or simple apps that only need basic navigation
  • Teams that prefer a declarative routing approach like go_router or auto_route

Strengths

  • Compile‑time type safety for navigation
  • State‑first architecture keeps page state separate from widgets
  • Automatic stack recovery from URLs
  • Dialog results survive app restarts

Weaknesses

  • Steeper learning curve compared to simpler routers
  • Less community support and fewer examples
  • Requires manual setup of PageStack and delegates

Setup

Kind
Flutter widgets
Effort
Medium
Code generation
No
Direct dependencies
4

Add dependencies, create a global PageStack, use PageStacksRouterDelegate in MaterialApp.router, provide PageStackNavigator

```dart
final pageStack = PageStack();
final routerDelegate = PageStacksRouterDelegate(pageStack: pageStack);
MaterialApp.router(
  routerDelegate: routerDelegate,
  routeInformationParser: PageStackRouteInformationParser(),
);
```

Alternatives

Packages that do the same job and could replace app_state.

  • go_router

    Simpler declarative routing with built‑in deep linking and state management via GoRouterState

  • auto_route

    Code‑generated routes with type safety and easy navigation API

Works with

Packages commonly used together with app_state: ones it builds on, ones built on it, and its own family.