Understanding Navigator 2.0 in Flutter
summary
Navigator 2.0 introduces a declarative pages list (immutable, rebuild to change) and a Router-backed workflow that syncs URL and back-button events with app state, available on the stable channel now. Examples show using Pages API to insert a page beneath the current one, a custom transition delegate to choose enter/exit ordering, and a Router widget with RouteInformationParser + RouterDelegate to parse URLs and restore paths. Demo code and a hacky pop-result completer are provided; core features work but some ergonomics remain unfinished.
AI-written summary · about
chapters (20)
- 0:00Introduction to speaker
- 0:49Why Navigator 2.0 matters
- 3:15Imperative navigation problems
- 5:49High-level Navigator 2.0 overview
- 7:35Use cases for new navigator
- 9:18Inserting pages in stack demo
- 11:27Navigator 2.0 key components
- 15:04Understanding Page objects
- 17:33Transition delegate explained
- 19:20Router widget deep dive
- 21:46Router components breakdown
- 25:00Using router in MaterialApp
- 27:09Live web demo walkthrough
- 27:50Pages API code example
- 31:26Pages API live demo
- 33:13Returning navigation results
- 33:55Router API code example
- 37:26Router delegate implementation
- 40:58Route information parser
- 41:19Q&A and closing remarks
related talks
26mVoyager: Navigation and DI for Flutter
40mHow I met Flutter
34mGoogle Flutter: The Next Frontier in Mobile Development
27mWhat's new in Flutter
31mHow Flutter works under the hood
30mNested Navigation in flutter web
22mIntroduction to Flutter
41mreal world use cases in Flutter with GoRouter and GoRouterBuilder
