Chapter 2 - InheritedWidget - Flutter State Management Course 💙

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

Комментарии • 27

  • @supercalifragilisticexpial5515
    @supercalifragilisticexpial5515 Год назад +3

    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 10 месяцев назад

    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

  • @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

  • @philosophia5577
    @philosophia5577 10 месяцев назад

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

  • @dhrubrawat9316
    @dhrubrawat9316 2 года назад +1

    Great.

    • @VandadNP
      @VandadNP  2 года назад

      Glad you liked this

  • @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. ;)

  • @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

  • @riteshkumartiwari153
    @riteshkumartiwari153 2 года назад

    Great

  • @souravsuman636
    @souravsuman636 2 года назад

    Thank you♥️

    • @VandadNP
      @VandadNP  2 года назад

      You’re welcome 😊

  • @kmdr
    @kmdr 2 года назад

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

  • @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