Why Navigator 2.0 Sucks
Video Statistics and Information
Channel: Tadas Petra
Views: 8,507
Rating: undefined out of 5
Keywords: coder, coding, programming, coding fundamentals, programming fundamentals, OSSU, open sourse, cs university, Navigator 2.0, flutter navigator, auto_route, navigator 2.0, flutter navigator 2.0, flutter, dart, dart programming, flutter programming, navigation in flutter, flutter navigation, complex navigation in flutter, complex app navigation, how to use navigator 2.0
Id: sxo6IcPtsuw
Channel Id: undefined
Length: 12min 56sec (776 seconds)
Published: Fri Jan 01 2021
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Some good points. Navigator 2.0 made me take a better look at how I handle navigation in my app.
Luckily both Navigator 1.0 and Navigator 2.0 are "just widgets" so I can safely ignore them and write my own navigation system. With 300 lines of code that manages all my navigation needs in a declarative fashion - (with panels and tabs like vscode has, each with their own navigation stack), I can watch the navigator debate from the sidelines.
Iirc navigator 2.0 is more intended to provide more flexibility vs being a navigator 1.0 replacement, so there's nothing wrong with sticking with the latter if you don't need the power.
https://medium.com/flutter/learning-flutters-new-navigation-and-routing-system-7c9068155ade
I hope filip from flutter will get on to this on boring show immediately...
If you ever tried to implement an own Router with JavaScript for web that allows deeplink and state mirroring you will clearly lead to the same API like Navigator 2.0. It's very flexible, fully-declarative, low-level API. That's fine. This allows devs to create different high-level APIs (like Navigator 1.0 API) based on that.
Also your facial expression on the preview image reminds me of someone having a rectal examination, lol.
navigator 1.0 was more dynamic, the 2.0 version is like a pageview but with a different context
I just use modular_flutter for navigation.
Great video and I agree overall, couple thoughts: * I think the page-less routes are still useful on top of paged routes, for nav that is ephemeral, like an onboarding or signup flow. Something that has 4 or 5 parts, and you don't really care to maintain as state, but you still want page transitions and backBtn support. * Not sure it's really complex vs simple, it's more like, can you define your app simply via state, then 2.0 works nice, but if you have tons of static routes that can kinda layer themselves in any way, then doing it with 2.0 could be a pit of a mess. * The real problem might be that they did not provide a simple way for the imperative Nav to hook into the OS and the Browser, which then basically pushes you into a state-first declarative approach.
If they had've made this simple system, to talk to and update the OS, we could also have used this to just roll our own custom solutions. Instead, everything is baked into Router, otherwise you're on your own. If you check the src though, it's not actually complicated what it's doing in terms of updating the URL or getting the args, you just have to use some low-level API calls.
States_rebuilder gives hope for easier to play with Nav 2.0:
https://github.com/GIfatahTH/states\_rebuilder/issues/249