nav
2.1.0, released 2 weeks ago by bansook.xyz
Context-free imperative navigation helper with built-in animations, dialogs, and deep link routing.
What it does
Provides an easy way to navigate in Flutter apps with context-free push and pop operations, built-in animated route transitions, dialogs, bottom sheets, and type-safe results. It supports deep linking via NavPathDelegate and can coexist with declarative routers like go_router.
AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want context-free navigation without passing BuildContext everywhere.
- You need custom animated route transitions or ripple effects easily.
- You want a type-safe result-returning screen API.
Skip it when
- You want a purely declarative navigation setup managed entirely by a modern router like go_router without imperative extensions.
Strengths
- Context-free navigation via a global navigator key or mixin.
- Type-safe screen results using NavScreen<Result>.
- Built-in route animations and ripple reveal effects.
- Compatible with both basic Material Apps and Navigator 2.0 routers.
Weaknesses
- Imperative navigation style may not fit complex state-driven URL routing architectures.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Mix `Nav` into your app state or call `Nav.init(navigatorKey)` once, and configure deep linking intent filters on Android and Info.plist on iOS if needed.
import 'package:nav/nav.dart';
// Push with built-in animation
Nav.push(const NextScreen(), navAni: NavAni.Blink);
// Push and await a typed result
final String? result = await Nav.pushResult(const TopScreen());Alternatives
Packages that do the same job and could replace nav.
- go_router
Official declarative routing solution with built-in URL-based navigation and deep linking support.
98Compare - auto_route
Type-safe declarative routing with code generation for complex navigation structures.
87Compare - beamer
Delegate-based declarative routing that synchronizes your app state with the browser URL.
50Compare