Understanding BuildContext in Flutter

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ม.ค. 2025

ความคิดเห็น •

  • @scienceblossom6197
    @scienceblossom6197 5 ปีที่แล้ว +12

    Answer to your question at 7:00 : I prefer the code to be written already beforehand in SUCH a video, where really typing code is just a waste of time and irrelevant to the main point of the video, however, in some cases typing the code might be the better way to go. So in my opinion, "it depends on the topic of the video". Really nice video Garett. Thanks.

    • @garrettlovetv
      @garrettlovetv  5 ปีที่แล้ว +1

      This is great feedback, thanks! Thanks for watching.

    • @jw4659
      @jw4659 5 ปีที่แล้ว +1

      Yes - I agree with this.

    • @melindauivari9537
      @melindauivari9537 4 ปีที่แล้ว

      Agreed

  • @williamkwabla
    @williamkwabla 4 ปีที่แล้ว +13

    Great explanation Garrett. I spent the whole day trying to understand the BuildContext from articles and your explanation here was perfect and I now understand how the context works now. Thank you very much.

  • @dariusfathi5520
    @dariusfathi5520 5 ปีที่แล้ว +12

    it's was a good deep explanation of what BuildContext is . thank you , and please do more like this !

    • @garrettlovetv
      @garrettlovetv  5 ปีที่แล้ว

      Thank you thank you! Will do!

  • @tadaspetra
    @tadaspetra 2 ปีที่แล้ว

    Awesome explanation. I knew what BuildContext was and knew to use Builder when it didn't work but this finally made it click as to WHY I had to do that. Thanks!

  • @mondomeccano
    @mondomeccano 2 ปีที่แล้ว

    Excellent video. It's helpful to hear an explanation of WHY it is needed rather just what it is and how its used. Seeing the code written out is great because the video can be paused while the following the explanation.

  • @Klazyo
    @Klazyo 4 ปีที่แล้ว +4

    Thank you so much , u Explained perfectly so basically context is juste looking back in the parent context but not in its child and builder do just that .
    ITs always like that we don't understand something in programming and we abandon but when we find out it all looks so easy and stupid the whole frustration we were in

  • @taimoorghafar1868
    @taimoorghafar1868 3 ปีที่แล้ว +1

    Now I can explain BuildContext to anyone 😎😎
    Thank you for such great explaination 💗

  • @azackmatoff2570
    @azackmatoff2570 4 ปีที่แล้ว +1

    This might be the best tutorial/explanation I've seen... You should definitely keep making videos on different topics! thanks man!

  • @syslinebilisim453
    @syslinebilisim453 3 ปีที่แล้ว

    I really understood clearly what you were conveying. Thanks a lot.

  • @isaacfinley11
    @isaacfinley11 4 ปีที่แล้ว

    Suuuuuuper helpful. You should do more Flutter videos. Thanks Garrett.

    • @garrettlovetv
      @garrettlovetv  4 ปีที่แล้ว

      You got it, thanks for watching!

  • @thinleyjimmydorji6396
    @thinleyjimmydorji6396 4 ปีที่แล้ว

    Thank you, Garett. I had this doubt since ages, a very great explanation. I would like more of this kind of video.

    • @garrettlovetv
      @garrettlovetv  4 ปีที่แล้ว

      You got it, thanks for watching!

  • @lezlee3137
    @lezlee3137 4 ปีที่แล้ว +1

    this is it! kind of tutorials we missing ...thank you and please we need more

  • @kengreg01
    @kengreg01 4 ปีที่แล้ว

    Thanks a lot, people in courses and tutorials forget to explain little things like this , I am just starting to use dart/flutter and I didnt find anyone who explained about this but everyone uses it.

  • @mortenha6998
    @mortenha6998 4 ปีที่แล้ว

    Great video Garrett. I'm just learing Flutter and Buildcontext is a tricky concept to understand.

  • @SteeveCabrel
    @SteeveCabrel 4 ปีที่แล้ว +3

    wow this just saved me hours of debugging. Thanks

  • @Ayrix06
    @Ayrix06 3 ปีที่แล้ว

    Thanks Garret. Best explaination ever :)
    You made my day

  • @rayanfernandes2631
    @rayanfernandes2631 4 ปีที่แล้ว

    Really good explanation dude... I understood context well enough!

  • @Jobic-10
    @Jobic-10 4 ปีที่แล้ว +1

    You earned a new subscriber :-) . Thanks for taking your time to explain. It meant a lot!

  • @sarojmaharjan3986
    @sarojmaharjan3986 4 ปีที่แล้ว

    Super clear and very effective explanation! Thank you so much! I prefer the code to be written already beforehand here in this CONTEXT.

    • @garrettlovetv
      @garrettlovetv  4 ปีที่แล้ว +1

      Great feedback, Thanks for watching!

  • @jajasaria
    @jajasaria 3 ปีที่แล้ว

    Save me time in my future dev. Thank u

  • @drsmiless
    @drsmiless 4 ปีที่แล้ว +1

    Great video, instantly liked. I hope I am correct, just to add up, the method (class_name).of(context) is a simplified version context.inheritWidgetOfExactType(class_name).. basically, it says "find me the nearest widget up the widget tree that can provide me with this class_name"

  • @akashbansal6216
    @akashbansal6216 3 ปีที่แล้ว

    Need more for this kind of content..

  • @sachinsaini4972
    @sachinsaini4972 4 ปีที่แล้ว

    Nicely explained bro
    Now I got what is really meant by buildcontext and the builder widget

  • @teen18pk16
    @teen18pk16 3 ปีที่แล้ว

    easily understandable and nice explanation bro

  • @dhananjaygavali8266
    @dhananjaygavali8266 4 ปีที่แล้ว

    Its great explanation about Buildcontext. It hard to understand for beginner but you make it easier. Can you please make video on setState() method and dispose() method to clear the instances

  • @raulcattelan4506
    @raulcattelan4506 4 ปีที่แล้ว

    Thanks for the explanation

  • @angryprogrammer7788
    @angryprogrammer7788 3 ปีที่แล้ว

    Really good explanation but now we have ScaffoldMessenger and it will work even if you pass context as is, but thank you it really helped me clear alot things about BuildContext.

  • @balaganesh3440
    @balaganesh3440 4 ปีที่แล้ว

    Loved it...great explanation 💯

  • @user-wr4yl7tx3w
    @user-wr4yl7tx3w ปีที่แล้ว

    why does the change of the second context to buildReturnContext makes sense? Just trying to understand which context it is now.

  • @lunaRdeltaY
    @lunaRdeltaY 2 ปีที่แล้ว

    great explained!

  • @higorgustavobarbosadasilva9624
    @higorgustavobarbosadasilva9624 3 ปีที่แล้ว

    Uau...you are amazing....I'm from Brazil. Thanks a lot.

  • @vicyoslinuxofficial2607
    @vicyoslinuxofficial2607 4 ปีที่แล้ว

    That was the best explanation that I've seen so far! Thank you so much! +1 subscribe!

  • @sudhapriyashrivastava6808
    @sudhapriyashrivastava6808 2 ปีที่แล้ว

    How to use Scaffold.of(context).openDrawer(); to construct drawer?

  • @iansmith3301
    @iansmith3301 3 ปีที่แล้ว +1

    You didn't explain why we can't use the existing context of the parent and pass it into the child, why do we need to make a new builder and new context??

  • @mauricio9783
    @mauricio9783 4 ปีที่แล้ว

    The fu*** video i was looking for. Finnaly understanding all the shit i was doing without undestanding... thanks

  • @anjannarla7846
    @anjannarla7846 4 ปีที่แล้ว

    can you make a video which explains difference between foreach and map method with an example

  • @CrazyOrdinal
    @CrazyOrdinal 5 ปีที่แล้ว +1

    I wanted to create a global service that has a function with showDialog method which can be called from anywhere. So how can i determine which context is currently active in my app or to out it the other way, how to get the context of current widget on screen without having it pass it as a parameter ( which i have heard is not a good way )

    • @garrettlovetv
      @garrettlovetv  5 ปีที่แล้ว +1

      I'm a really visual person so reading your comment I'm not sure. Is there anywhere I can see your code?

    • @CrazyOrdinal
      @CrazyOrdinal 5 ปีที่แล้ว +1

      @@garrettlovetv No can do, its a corporate project. Can't share, but appreciate the effort. I will create a demo one for reference, till then context as a parameter it is

  • @gauravbhardwaj777
    @gauravbhardwaj777 5 ปีที่แล้ว

    Great video and really hepls in understanding the concept .

  • @remo12889r
    @remo12889r 4 ปีที่แล้ว

    Thank you. This was a nice explanation

  • @murshidahamed8317
    @murshidahamed8317 3 ปีที่แล้ว

    yes very good explanation thanks ah lot

  • @lifestylelifestyle
    @lifestylelifestyle 4 ปีที่แล้ว

    thank u so much

  • @sepphashemi4324
    @sepphashemi4324 3 ปีที่แล้ว

    u explained amazing bro amazing

  • @pfuhad3760
    @pfuhad3760 4 ปีที่แล้ว

    Thank you

  • @zond_amond
    @zond_amond 4 ปีที่แล้ว

    Great video, thank you!

  • @amirhoseinazhdarnezhad9168
    @amirhoseinazhdarnezhad9168 4 ปีที่แล้ว

    It was helpful. Thank you

  • @silinhuang7395
    @silinhuang7395 4 ปีที่แล้ว

    Thanks bro, great explaination!

  • @octap182
    @octap182 4 ปีที่แล้ว

    So I have a flutter ListView with an image picker in a column beneath the title and subtitle, but choosing an image opens that image in every tile instead of the one it was clicked from. How can I use context to only open the selected image in that specific tile it was called from, in the same vertical tree inside a card? I can not figure this out, I think it is impossible.

  • @miladhesami6630
    @miladhesami6630 2 ปีที่แล้ว

    Hello, please Volume it up or use a microphone to produce quality voice

  • @dip4040
    @dip4040 4 ปีที่แล้ว

    you need more exposure.God!Your explanation is amazing.A 10 year old can understand.

    • @garrettlovetv
      @garrettlovetv  4 ปีที่แล้ว

      Much appreciated, thank you!

  • @demosongsheetmusic
    @demosongsheetmusic 3 ปีที่แล้ว

    Great video! :) Nice explanation, with multiple different approaches, good job!
    At least for me, it's not a problem to have the code written out already, as long as you go through it.
    The only thing I didn't like in the video is the various flashing colors on you and in behind - I guess you have some kind of a fancy light in your room, but it might be better to turn if off while recording 😬
    Thank you for the efforts!

  • @headscreww
    @headscreww 4 ปีที่แล้ว

    Thanks it helped a lot

  • @Leotobonilima
    @Leotobonilima 4 ปีที่แล้ว

    boa me ajudou muito, thx from brazil!

  • @harrywang6792
    @harrywang6792 3 ปีที่แล้ว

    type it helps so much more

  • @jy00952077
    @jy00952077 4 ปีที่แล้ว

    so helpful,thank you !

  • @bartekpa
    @bartekpa 4 ปีที่แล้ว

    Awesome explanation, thanks! :D

  • @aspiresun
    @aspiresun 5 ปีที่แล้ว +1

    great video !!

  • @dennycad7859
    @dennycad7859 3 ปีที่แล้ว

    thanks

  • @shunmuagapriya9877
    @shunmuagapriya9877 4 ปีที่แล้ว

    Flutter upload new video bro. It's so good

  • @aashishmanandhar5188
    @aashishmanandhar5188 3 ปีที่แล้ว

    talking while writing the code side wise ( explaining it) would be more helpful, imo

    • @garrettlovetv
      @garrettlovetv  3 ปีที่แล้ว

      Noted, thanks for the feedback!

  • @chethansiqaandiostuff7365
    @chethansiqaandiostuff7365 4 ปีที่แล้ว

    I appreciate your efforts but it is still not clear to me.Yes it is clearer than before.May be you can come up with another analogy though whatever you gave in the video was ok,for me atleast.Nice voice by the way!!!!

  • @spinoff2011
    @spinoff2011 3 ปีที่แล้ว

    lights in the back are not cool 🤮

  • @rajatbaniya3833
    @rajatbaniya3833 4 ปีที่แล้ว

    nerd