Flutter Navigator 2.0 for Beginners

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ • 54

  • @tobycettera
    @tobycettera 3 роки тому +17

    Thanks this was the most basic use of Nav 2.0 I have seen and really helped me understand the base principle. all other examples I have seen use the delegates to generate pages lists. Nav 2.0 is more complicated than routes but that is because it is attempting to unify browser navigation with phone app stack style navigation. In apps you always have to go from this screen to that screen to get to a third screen (imperative). In a browser you can go straight to the deeper screen but logically Nav 2.0 allows you to declare (declarative) what the nav state would look like. That is where the complexity comes from and many people are just trying to use pages in the same way they did routes so it looks like extra work for no gain.

    • @PauloHenriqueNonaka
      @PauloHenriqueNonaka 3 роки тому +5

      Thanks for making this comment. When Nav 2.0 was released that was exactly my thought: extra work for no gain. Over complication for no reason apparently. Now, we're enabling our mobile app to be web as well and we just faced this situation where we would like to navigate directly to some specific page since we are now in a browser, what makes sense. We migrated to Flutter 2 and published to the web, but deep linking on the browser isn't working at all. I asked myself then if the culprit was the Nav 1.0 and it seems so. What I think is very strange is why nobody mention that you need Nav 2.0 in order to make deep linking to work on Flutter web. At least I couldn't find any reference to it in the documentation and it has only been my guess so far that I should migrate in order to make it work. My app is a big and would be very helpful if it was clear on the docs before I make this effort of migrating.

  • @danielelmuneco1994
    @danielelmuneco1994 3 роки тому +32

    That logic does not seem to escalate well for larger apps

    • @FilledStacks
      @FilledStacks 3 роки тому +3

      I think it won't scale well at all. I'm busy exploring it now, and i think it's not gonna do very well for production sized apps.

    • @FilledStacks
      @FilledStacks 3 роки тому +1

      @Taras Tataryn I have tried, but I couldn't. we don't use it in production so I have nothing extra to add to tutorials that are already out there.

  • @antonyaz3506
    @antonyaz3506 2 роки тому

    Its better video about Navigator 2.0 )) Thank you

  • @tthtlc
    @tthtlc 2 роки тому

    thank you: 10 mins short video focusing on key concepts and key parts of the source codes is GOOD!!! Other video is like HOURS going through LINE BY LINE of flutter.....OMG!!!!! you are fantastic.

  • @DanFlorio
    @DanFlorio 3 роки тому +1

    Thanks. A good basic intro to a topic that has been kicking my ass. There are lots of examples out there, but none of them work out of the box, like this one did (mostly).
    This code isn't null-safe. If you copy the code from the git repo don't forget to add
    // @dart=2.9
    at the top of your file to remove the errors.

  • @unnikrishnanadoor
    @unnikrishnanadoor 3 роки тому +26

    Seems like it's overcomplicated. can't we do it in simple steps? do we really need this much complication?

    • @FilledStacks
      @FilledStacks 3 роки тому

      I'm trying to figure that out now to make a tutorial. this is waaay to complicated.

    • @terminalterm2367
      @terminalterm2367 3 роки тому

      @@FilledStacks I went looking for your tutorial, but you haven't made it yet :(

    • @FilledStacks
      @FilledStacks 3 роки тому

      @@terminalterm2367 I don't use it in production so I have nothing to share that other teachers hasn't shared already.

  • @sergey_molchanovsky
    @sergey_molchanovsky 2 роки тому +1

    Thanks for the video. This explains a new Navigator and its Page API.
    I'd like to see Router and RouterDelegate explanation too.

  • @RobertoOrtis
    @RobertoOrtis 3 роки тому +5

    It doesn't make much sense to use 2.0 if you are not using web

  • @bobby9568
    @bobby9568 3 роки тому

    just found this amazing channel! subscribed!

  • @samrystrom3532
    @samrystrom3532 3 роки тому +1

    Great video - really get the principles at work with the new Navigator. Thanks.

  • @kyleaustin2728
    @kyleaustin2728 3 роки тому +2

    As someone named Kyle, I oddly appreciate your random name selections.

  • @bernardnaques2951
    @bernardnaques2951 2 роки тому

    really nice explanation, thanks !

  • @TheMacpardo
    @TheMacpardo 3 роки тому +2

    Thank you for the great tutorial!

  • @George-or3uv
    @George-or3uv 3 роки тому

    This was a big help to me, thanks.

  • @alexboyd2693
    @alexboyd2693 2 роки тому +1

    Mr. Loco, I'm fairly new to Flutter and have been trying to lock down the navigation paradigm that we will use for our app. With the Navigator 2.0 approach, I see some benefits, but I'm wondering how it will work for a large app? I can see that list of pages:[] becoming quite large and non-intuitive if it has a bunch of flow control code in it. Additionally with the onPopPage. Is it worth going this route (haha) or would using Advanced named routes with onGenerateRoute (per flutter navigation documentation) be better? I have found that I can't popUntil() with the onGenerateRoute method, though that may be a lack of understanding on my part.

  • @swatirai1
    @swatirai1 Рік тому

    i am using navigator 2.0 for navigation but the problem is that when i clicked back button of android device then app getting close instead of taking back to previous page how to solve this problem plzz explain this

  • @FlutterMapp
    @FlutterMapp 3 роки тому +4

    Damn, that is some Legendary explanation! Kilo, do you know about the Red Button under your video? Apparently I clicked on it and now it is grey. Good one man ✌🙌

  • @marodonthemorone
    @marodonthemorone 3 роки тому +1

    Great tutorial!

  • @hakanviajando
    @hakanviajando 2 роки тому

    Thanks, great video. Flutter's own doc is actually not enough for this feature and is complicated.

  • @aimensayoud8563
    @aimensayoud8563 2 роки тому

    thanks for the explanation it was very clair , but why we need to use this navigator when the old one was much simple and doesn't need all that code

  • @CanalMateriaGriz
    @CanalMateriaGriz 2 роки тому

    How do you use Navigator 2.0 with web? Like, how do I specify the URL navigation?

  • @allaboutpv
    @allaboutpv 2 роки тому

    how do you navigate to different dart pages? I have 8 different dart pages and I am trying to connect them all with a drop-down page but cant figure it out it just gives me this error: Navigator operation requested with a context that does not include a Navigator.

  • @benjaminsmith9943
    @benjaminsmith9943 9 місяців тому

    Well, guys, this project is not null safe, and the Dart SDK as I write this (3.2.3) only supports null safety. This makes this video, for me as a relative newbie, largely useless.
    I spent a good part of the last hour chasing fields being nullable and being unable to pass this or that variable because it could be null before giving up.
    Author: would you please update this so peeps like me can benefit?

  • @PriyaSharma-lq2dw
    @PriyaSharma-lq2dw 3 роки тому

    Could you please explain why does the pages parameter of navigator is a list instead of just one page? The navigator is being built every time there is a change in the app state, so why not just put one page in the navigator corresponding to the current app state? Why have a stack of pages? We are not calling pop anyway, so when will the lower pages in the stack be displayed?

  • @josma3436
    @josma3436 3 роки тому +1

    So, you have to control the state of 30 - 40 views each one? can you in certain views navigate imperatively??, because with this approach there must be a global state where you can set conditions to stack or not a given view.

    • @ElteHupkes
      @ElteHupkes 3 роки тому

      This was exactly my initial concern after watching this, that one top level class seems to have a lot of responsibility. On the other hand, in order to have a single declared route state, there needs to be... a single declared route state 😛. I guess it could be structured such that the navigator only contains the state necessary to set up what the views are, and not the state of the views themselves.

  • @jayamuruganj5091
    @jayamuruganj5091 3 роки тому

    pls done the web app using navigator 2.0 showing the url path when the page will change

  • @tranminhhaifet
    @tranminhhaifet 3 роки тому +1

    Thank you!

  • @abdulrahamanolatunde6548
    @abdulrahamanolatunde6548 2 роки тому

    Hi Kilo, can you create a 5 screen app using Navigator 2.0? Can come in a auth kind of app and some navigations around after logging in. This will really help the learning 🙏🏼

  • @evanpease6732
    @evanpease6732 3 роки тому +2

    Navigation in flutter is the worst I’ve ever encountered. Really needs to be rethought and redesigned from the ground up. It’s not usable.

  • @MuhammadAli-zv5vz
    @MuhammadAli-zv5vz 3 роки тому +1

    Too much difficulty, Its very cofusing and difficult for understanding. How can we use Navigation in Tabbar App and in complex apps?

  • @donathmm3881
    @donathmm3881 3 роки тому +8

    The old navigator is much better and easier than this stuff

    • @Kilo_Loco
      @Kilo_Loco  3 роки тому +1

      Easier maybe, but inconsistent with the declarative paradigm of Flutter

    • @uris77
      @uris77 3 роки тому +3

      @@Kilo_Loco Hmm, I agree with the op. The new navigator isn't declarative either. There is a lot of imperative code that needs to go inside `onPopPage`. It is a matter of tradeoffs I guess. I prefer the old navigator, because I can quickly see a list of routes and navigate to the main pages on the app from the router itself. It can be done with this new navigator through `pages` , but logic in `onPopPage` can obscure that a bit and I find it a bit error prone. I wished the new navigator were a bit smarter and avoided the `onPopPage` setup.
      Anyway, thank you for the tutorial. I enjoyed it.

    • @testingcrap5419
      @testingcrap5419 3 роки тому +1

      @@uris77 You cant mantain the state of the navigator after refreshing in the browser with Navigation 1.0. The declarative approach is way better.

  • @АндрейИльченко-т7ж

    Thank you

  • @SravanKumarPabolu
    @SravanKumarPabolu 3 роки тому

    Thank you.

  • @Prashant-7
    @Prashant-7 3 роки тому

    Should I start to learn flutter , I am iOS developer working with swift

    • @Kilo_Loco
      @Kilo_Loco  3 роки тому +2

      If you want.... I like it and knowing multiple languages/frameworks will make you more aware of different programming techniques

  • @francescotagliavento8081
    @francescotagliavento8081 3 роки тому

    Should I use adobe xd with flutter ? what do you think?

    • @Kilo_Loco
      @Kilo_Loco  3 роки тому

      The design program doesn’t really matter tbh. Any tool that helps you visualize the product will work. I use Sketch, and will sometimes recommend Figma because it’s free. There’s nothing wrong with XD tho

  • @NickRossik
    @NickRossik 3 роки тому

    I recently updated Xcode and all my applications don't build. It's time to move to flutter.

    • @Kilo_Loco
      @Kilo_Loco  3 роки тому +5

      Haha well I don’t think that switching platforms is the answer to that problem. I can confidently say that native iOS development is the most stable platform with the least amount of problems.
      That said, flutter is a great cross platform option that works really well

  • @joshlim8595
    @joshlim8595 2 роки тому

    Very confusing