Thanks for this simple and approachable intro to Nav2. As noticed and commented, it is a lot of boilerplate indeed. Reason for that is to enable building navigators for much more complicated cases. For basic stack push/pop and its named variant, Nav1 or packages based on it to even simplify it (eg autoroute, fluro, get) are still very good alternatives. I am looking forward to seeing packages that make using Nav2 simpler and less boilerplaty for some specific more advanced use cases, often related to Web and Desktop navigation and their seamless transition to phone sized navigation. Not only url handling, but eg inserting master/child view page as poppable page when you resize the screen to phone size. Totally doable now that you can easily control the page stack.
Not a fan of how most people do navigation... I tend to hide the navigation logic inside the page you are navigating to So when navigating I just call a async handler: final result = await BookPage.navigate(context,book); Then I can handle the result of the popped page in a linear fashion. I think people are overcomplicating navigation... Thanks for the video, nice introduction to the new navigator
I really like your method to explain and share in flutter learning (in many of your videos), put it in real life case to make me more easy to understand the logic inside of coding, great works and thanks!
It's simple. * Open VS Code Settings (by pressing ctrl + ,) * In search bar, type "flutter UI guides" * Now TICK the checkbox - (preview flutter UI guides)
Hi, please Let me know if I add a new page support page totally unrelated to book and doesn't depend on _selected book . On a button click from anywhere take to support page . How can we navigate from any page to support page
@@arthurlima923 Here in Brazil we belive that it will used just for packages to easely some tasks, and that the "normal user" will continue to use nav 1.0.
@@arthurlima923 Então, com vista nisso a comunidade (Flutterando) está empacotando o nav 2.0 dentro do Modular (pacote que te auxilia com gerenciamento de rotas e injeção de dependências)
I thumb up because it is easy to follow as a basic introduction to Navigator 2.0 The best moment is when he says: "Personally, I don't know exactly what onPopPage does". 😀 That comment tells how messy is the new Navigator API.
so basically it listens to the change of selected book automatically so we just change the state that's all that's kind of cool with state management its easy
@@LearnFlutterCode I understand this.. but I not understand that flutter web navigation.. if u kind can give example again that not have id book like a simple navigation to the next screen using navigation 2.0
for simple cases, this method is too complex. however, if you want to have users change the url and sync with your flutter web app, then this is one way.
@@LearnFlutterCode For any case, this is too complex. I have no problem synchronizing my URL with the existing system & Fluro - and I'm currently exploring ways to get Fluro out of the mix. Someone must be feeling the need for some extra job security, needlessly complicating things so nobody can follow behind them. What ever happened to 'optimize for developer happiness'?