Chapter 2 - InheritedWidget - Flutter State Management Course 💙

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

КОМЕНТАРІ • 27

  • @supercalifragilisticexpial5515

    What was the whole point of the _textKey? I tested out by giving my DateTimeWidget a static key but it still refreshes when you click on it while I would expect it would only change the title and not the body?

  • @codegambit2507
    @codegambit2507 2 роки тому +2

    Great video. I'm learning a lot here. @9:35, I think what it means is that you *must* pass a function to setState, even if the function returns null.

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

      Thanks for the info and good point 💙

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

      @@VandadNP I think that assert statement was written before null safety was introduced to Dart.

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

    Thanks a lot. I think if you incorporate some diagrams in your explanations that would be amazing.

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

    If we have to use setState to redraw the UI anyways, whats the point of Inherited WIdget??

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

    that's great
    thank you so much

  • @tareqamenah9964
    @tareqamenah9964 2 роки тому +2

    Thanks for this explanation!
    I just want to ask you is it required to use a "key" with DateTimeWidget?
    As I know when we call "setState" in HomePage then the DateTimeWidget instance will rebuild in all cases because it is a child for HomePage, isn't that right?

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

      You could experiment by removing the key and seeing what happens. It's always good to change the code and see the result you get 🔥

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

      Tried it will work without using key also. But if after removing key if we add const keyword in front of DateTimeWidget then it will not update.

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

      @@riteshkumartiwari153 It does here. ;)

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

    Thank you for this course! May I ask what software do you use to record the videos?

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

    I didn't understood the point or whats going on!!

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

    thank u, but how do you know all of this information, i was reading document from flutter, but never see that in development title
    pls, share the way y learn it

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

    Great.

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

      Glad you liked this

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

    Thank you♥️

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

      You’re welcome 😊

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

    Great

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

    I am confused, I thought the whole idea of inherited widget and creating a stateless custom text widget was so that when we need to update the custom widget we only rebuild it and not needing to rebuild the whole widget, I even tried using the Custom text widget without adding its key and it still works because the whole widget is been rebuilt when set state is called. Pleas help me understand the whole point.

    • @seatconnect224
      @seatconnect224 11 місяців тому

      during rebuilding tree Flutter first comparing widget type and then key of the DateTimeWidget so Flutter will know which exactly widget has changed. Flutter traverse app tree and replace old DateTimeWidget Element with new DateTimeWidget Element as key doesn't match in your case. But for example if will have one more DateTimeWidget with key that not changed(some const value), then this widget Element will not be deleted from flutter tree and this widget wouldn't be changed.
      Also that is why flutter has so good performance, reuse existing object without recreating them if not needed )
      Also recommend to learn about flutter tree, after understanding it will be much easier to understand other flutter concepts

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

    can you give the link of this repo on github please please 🙏 ?

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

    Source Code?

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

      I usually don't provide source code for small chapters. Are you stuck at a specific part or generally curious where the source code is?

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

      @@VandadNP getting the source saves a lot of time. i can edit the codes and try all edge cases on the other hand if we see the video and do the codes on IDE it's time consuming. so i request you to please upload. it may not take a lot of time to upload from your side bcz you have the codes. i tried to find the codes on your git i failed