I'm developing a fairly complex cross-platform (Android / iOS / web) app in Flutter. I'm new to Flutter, coming to it from a background of native development for Android and iOS.
I have been researching the best way to handle navigation and state management in Flutter, and my conclusion so far is that the best approach would be to use the Navigator 2.0 API in combination with the Riverpod state management library. As far as I can see, these seem to be the most up-to-date and powerful libraries for navigation and state management in Flutter.
However, I have not found it easy to figure out how to integrate Riverpod with Navigator 2.0. As someone who is new to both libraries and indeed to Flutter in general, I would ideally like to have found some canonical example in the docs (either the Navigator or the Riverpod ones) which shows how this should be done, but I haven't found such an example. In the absence of that, I would be really grateful for any guidance about how to do this, and in particular about which of the many types of Riverpod Providers is best suited to the job of handling navigation state. For example, what would be a reason to prefer ChangeNotifierProvider over StateNotifierProvider, or vice versa? Is there some other kind of Riverpod Provider that would work better than either of these?