Search code examples
flutternavigationnavigator

Is it better to shift from Navigator 1.0 to Navigator 2.0 in Flutter?


I am using still Navigator 1.0 in my all current flutter apps. If I want to migrate from Navigator 1.0 to Navigator 2.0, I found auto_route flutter package only suits for our requirements. Because many code depends on data passing between front and back screens which supports auto_route package.

So I need some suggestions to migrate from Navigator 1.0 to Navigator 2.0 now or not. Any chances to deprecate navigator 1.0 by flutter team in future versions of flutter.

Suggestions would be appreciated.


Solution

  • Here is a good article on the subject:

    https://denis-bohatyrov.medium.com/why-you-should-not-use-navigation-2-0-with-flutter-d1c1fe8a485a

    Conclusion:

    1. Navigator 2.0 is an alternative and not a replacement. 1.0 will never be deprecated.
    2. Navigator 2.0 is way more complex than 1.0. Use 2.0 only if you want to support the Web, especially deep links and browser navigation buttons on nested routes.