NavigationIntermediate30 XP4 min read
What is the difference between Navigator 1.0 and Navigator 2.0?
TL;DR: Navigator 1.0 is an imperative stack API (push/pop). Navigator 2.0 is a declarative API driven by a Router and RouterDelegate — required for proper deep linking, web URL management, and platform back-button handling.
Full Answer
| Aspect | Navigator 1.0 | Navigator 2.0 |
|---|---|---|
| Style | Imperative: push(), pop() | Declarative: page list driven by state |
| Deep linking | Limited — requires workarounds | First-class: RouteInformationParser + RouterDelegate |
| URL sync (web) | Not supported natively | Syncs URL bar with navigation state |
| Back button | OS back = pop | Fully customizable PopNavigatorRouterDelegateMixin |
| Boilerplate | Minimal | Significant — use go_router to reduce it |
🎯
In practice, use go_router or auto_route instead of raw Navigator 2.0. They implement the RouterDelegate/RouteInformationParser layer for you, giving you deep linking and URL sync with a simple API.
Code Examples
dartNavigator 1.0 vs go_router comparison
Output
Both navigate to DetailPage(id: '42'); go_router also handles the URL bar on Flutter Web and OS deep links
Common Mistakes
- ✗Implementing raw Navigator 2.0 without a library — extremely verbose for little gain
- ✗Using Navigator.push inside a go_router app — causes inconsistencies with URL state
Interview Tip
💡
Say you understand the Navigator 2.0 architecture but use go_router in practice — this shows both depth and pragmatism.
#Navigator#Navigator-2.0#Router#deep-linking#declarative