BuildContext?! | Decoding Flutter

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024
  • What is “BuildContext” and how is it used? In this video, we discuss what BuildContext is, and why it shows up in so many widgets and builders.
    Leave us suggestions for code to unravel in the comments below!
    Watch more Decoding Flutter episodes → goo.gle/Decodin...
    Don’t miss an episode, subscribe to Flutter → goo.gle/FlutterYT
    Get started with Flutter → goo.gle/Flutter
    Learn more about the Dart Language → goo.gle/2YF9OCi
    #DecodingFlutter #Flutter #Developer

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

  • @hemanthkotagiri8865
    @hemanthkotagiri8865 3 года назад +166

    I've never seen a community so passionate to educate the world in a simple, fun way possible than Flutter team. You guys are awesome. Keep it up, I've chosen flutter for all my application development stuff and I will never go back to anything.

  • @trends.matter
    @trends.matter 3 года назад +82

    Flutter community is growing day by day :)

    • @deepmeyt
      @deepmeyt 3 года назад +5

      WE SHALL CONQUER THE REALMS OF FRONTEND DEVELOPMENT

  • @givolimyerukim
    @givolimyerukim 11 месяцев назад +2

    I just rewatched this 3 times, it's that much that I enjoyed this explanation.
    My mind in blown, and my mood is elated

  • @AshwinKumarOSE
    @AshwinKumarOSE 2 года назад +9

    I absolutely love your explanations Andrew. You make it so easy to understand the filter concepts.

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

      Thank you for your kind message of support, Ashwin! Thanks for watching 😎
      Be sure to catch more Decoding Flutter episodes here: goo.gle/DecodingFlutter

  • @mhmzdev
    @mhmzdev 3 года назад +3

    Who so ever is doing those motion graphics, just nailed it! 🔥

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

    Best explanation of the build context. Great stuff.

  • @DigitalDesignET
    @DigitalDesignET 3 года назад +2

    Just wanted to say thank you for all hard work, from Ethiopia.

  • @avinandanganguly4466
    @avinandanganguly4466 2 года назад +2

    Brother you are amazing. Only a sensational engineer can have such exceptional clarity on such complicated subjects

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

      That's not an engineer, it's a developer advocate. Very different thing

  • @maxeem3596
    @maxeem3596 3 года назад +1

    Andrew Fitz, thank you!
    The Decoding Flutter series with you are amazing.

  • @Mindstream_
    @Mindstream_ Год назад

    Wow, love these tutorials. Thanks so much.
    My brain is constantly exploding on my way learning flutter. Having had a 15 year break from c++ to now diving deep into this advanced language isn't always easy. But oh so mind blowing.

  • @warperone
    @warperone 3 года назад +6

    love these kind of bite size updates...would be good if they were appended with a "deeper" dive view of the topic ... in this case really unpack via examples and animations how it really works

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

    it 's so clear i had difficulty to understand elementTree but in this video it's clear for me thank's very much.

    • @flutterdev
      @flutterdev  Год назад

      We're glad this helped clear things up for you!
      Make sure to check out the rest of our Decoding Flutter series for anything else that may be giving you trouble: goo.gle/DecodingFlutter

  • @dampfwatze
    @dampfwatze 3 года назад +2

    I like the Lego ship in the background!

  • @smiljantukic
    @smiljantukic 2 года назад +2

    Thank you very much for such amazing documentation. I have started to learn Flutter for my private project and videos like this helps a lot.

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

      Thank you for the excellent feedback, Smiljan! Don't forget you can view more Decoding Flutter videos here: goo.gle/DecodingFlutter

  • @hyungtaecf
    @hyungtaecf 3 года назад +10

    Element implements BuildContext 🤯

    • @RedAlpha58
      @RedAlpha58 3 года назад +1

      🤣 my reaction too

    • @dilshan3372
      @dilshan3372 3 года назад

      Yes, The BuildContext interface is used to discourage direct manipulation of Element objects

  • @hybrayhem
    @hybrayhem 3 года назад +3

    this short series are great

  • @postedactive
    @postedactive 3 года назад +3

    So BuildContext is exactly what I thought it was lol, but it's good to learn 😀

  • @abraham7966
    @abraham7966 Год назад +1

    I'm coming from React Native. Giving Flutter a chance. Pretty great video! Flutter's documentation is unmatched.

    • @flutterdev
      @flutterdev  Год назад +1

      That's awesome to hear, Abraham!
      Welcome to the Flutter community! We're happy to have you here 👋

    • @abraham7966
      @abraham7966 Год назад

      @@flutterdev Well thanks! See? I never get an "official" reply from React Native. Nah, this is too good!! Where is the catch? Haha, I think I will end up rewriting my RN apps very soon!!

  • @budhiono7740
    @budhiono7740 2 года назад +3

    Sorry, since I'm still a flutter newbie, I still dont understand it.
    How about simple explanation with html approach, eg. if a widget is an html element, what is buildContex or context ?
    Thank in advance

  • @tejasmd8143
    @tejasmd8143 3 года назад

    Now that's why we say, "Enough talk, show the code".
    It's literally the best way to explain.

  • @seatconnect224
    @seatconnect224 Год назад

    it was my n-th video about trees and finally I get it, thank you!

  • @GET_1T_D0NE
    @GET_1T_D0NE 3 года назад +1

    Thanks for the information about 'What is Element type ?'... Answer-Element is a BuildContext type

  • @CarloDotLog
    @CarloDotLog 3 года назад +2

    Great! I love this series! Thank you.

  • @ayushchothe8785
    @ayushchothe8785 3 года назад +5

    Make a video on explaining RenderBox

  • @viditkhanna3721
    @viditkhanna3721 3 года назад +20

    So whenever we pass a context to a widget, we are actually passing the element of that widget, so it can know where it is at?

    • @filiphracek
      @filiphracek 3 года назад +10

      Exactly!

    • @dilshan3372
      @dilshan3372 3 года назад +12

      01. Firstly Framework call constructor of that widget class.
      02. Secondly framework call the "createElement()" method. And this method will return element of that widget to framework.
      03.Thirdly when framework calling "build(context)" method, it will pass previously created element object as a argument for context parameter.
      So now we can use context(element object's) properties and methods inside the build() method. (Eg:- accessing ancestor widget / for makimg dependencies with ancestor inheritedWidget.

    • @xuantung8660
      @xuantung8660 3 года назад +1

      ​@@dilshan3372 Could you explain why the framework need 3 steps like that and not the other way?

    • @dilshan3372
      @dilshan3372 3 года назад

      @@xuantung8660 I dont know what you mean by other way.

    • @xuantung8660
      @xuantung8660 3 года назад

      ​@@dilshan3372 Example, why don't we create element as a property of widget, and build() don't need context parameter because we can access it by widget.context?

  • @samldev
    @samldev 3 года назад

    Cool to get a quick peek under the hood. Great video!

  • @이창환-v1x
    @이창환-v1x 3 года назад

    So easy and intuitive explanation!

  • @rifaldhiaw
    @rifaldhiaw 3 года назад

    You know what. The flutter team is AWesome!!

  • @talhakhantk8022
    @talhakhantk8022 3 года назад +7

    Explain about border property in decoration as well I am very confused what kind of Widget it takes

  • @CarlosWashingtonMercado
    @CarlosWashingtonMercado Год назад

    So, every widget is a backpack that can in turn hold an (potentially) infinite numbers of backpacks?

  • @consciousmayank
    @consciousmayank 3 года назад

    Hi, a great video. I was asked about buildContext in an interview. Hope I would have known this earlier. ☺️. Just a random question out of the "Context", how to show the done button in number keyboard in iOS? This can be the next video... or you can point me to a certain direction.

  • @guywhocodes
    @guywhocodes 6 месяцев назад

    sounds good. a nice explaination.

  • @mangkepweng3741
    @mangkepweng3741 3 года назад

    I LOVE THE MUSIC .... WOWOW ...

  • @StingSting844
    @StingSting844 3 года назад +1

    This should be the first lesson after hello world in flutter.

  • @tobyying1955
    @tobyying1955 2 года назад +2

    Manipulating Elements directly is too risky. Users can call and modify any of the Element's properties and methods.
    To avoid this, the Element base class implements the abstract BuildContext class so that users can only use the methods and properties BuildContext allows, which is a good design idea. --This is what I think.

  • @FlutterMentor
    @FlutterMentor 3 года назад

    Great explanation!

  • @GAMEOLOGIST
    @GAMEOLOGIST 3 года назад

    Nice explanation !!

  • @venkatareddy6122
    @venkatareddy6122 3 года назад

    Super . Nice Job Flutter TEam

  • @ulyssis
    @ulyssis Год назад

    so, is BuildContext the silve bullet to creat a widget at any place?

  • @8nehe
    @8nehe 3 года назад

    Awesome explanation

  • @hboleto
    @hboleto 3 года назад

    Always with fully helpfull hints

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

    good but why is it that flutter doesn't handle this in the background somehow without us having to pass it around?

  • @Smart-workers.VS.Hard-workers
    @Smart-workers.VS.Hard-workers 2 года назад +1

    Amazing bro

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

      We're so glad you enjoyed this, Buddhika!
      Be sure to catch even more Decoding Flutter episodes here→ goo.gle/DecodingFlutter
      Happy Fluttering 👍

  • @MdSiam-kw5ox
    @MdSiam-kw5ox 2 года назад +1

    I have NO idea what you have just said.
    What is BuildContext?

  • @ArnabGuides
    @ArnabGuides 3 года назад

    this was really awesome

  • @nahomgebreamlak1675
    @nahomgebreamlak1675 3 года назад

    I have a question when u will add full support for smart Tv

  • @DanFlorio
    @DanFlorio 3 года назад

    Coming from a Flash/Flex background "context" feels like "this".

  • @bharathkrish6743
    @bharathkrish6743 3 года назад

    Explained very well..

  • @mohammadalrefaai-games8034
    @mohammadalrefaai-games8034 3 года назад

    Thanks that's very useful ☺️

  • @mibi2007
    @mibi2007 3 года назад

    Hi Flutter team, could you make a video to explain the scrolling in Flutter, I am confuse with using them, and they are too many Classes with Scroll on it's name. Thank you

  • @physics.matter
    @physics.matter 3 года назад +1

    Thanks andrew:)

  • @victormanuelsantosmartinez6129
    @victormanuelsantosmartinez6129 3 года назад

    Amazing!!!! 👏🏾

  • @adrianchacon335
    @adrianchacon335 3 года назад

    If I need to know when the phone is shutting down could I do in flutter?

  • @prasaddhend5500
    @prasaddhend5500 3 года назад

    Can i use the different google play console account for uploading my project on playstore
    I have to impliment in app purchase and ads in my project
    But i have a google play console account with different gmail address and my project is with different gmail account with firebase ?

  • @sumerlakhera5257
    @sumerlakhera5257 3 года назад

    When we open any app then for the first time when home page arrive it shows a short tutorial that teach u how app work I want to implement this function in my app but i don't know how to do , can u tell me Function name Please....(I am not telling about splash screen ) I want overlay on app

  • @joelpaul8650
    @joelpaul8650 2 месяца назад

    funny how flutter is googles, youtube is googles, so this video is googles and still the captions say dark for dart.

  • @azackmatoff2570
    @azackmatoff2570 3 года назад

    Didn't watch the whole video, but context is the address of the either stateful or stateless widgets.

  • @baraaaljabban9058
    @baraaaljabban9058 3 года назад

    Good to know 😁👌

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

    A real world example would be really beneficial to include with this video. The context here is still confusing for new comers.

  • @bilalrabbi6401
    @bilalrabbi6401 3 года назад

    But why it is not available in FCM background handler..

  • @LeoPorras
    @LeoPorras Год назад

    Thanks a lot

  • @junama10
    @junama10 Год назад

    I want that playmobil ship

  • @darshanpandya7778
    @darshanpandya7778 3 года назад

    Information = Gooood
    IDE Theme = Baaad 😗

  • @amans6504
    @amans6504 3 года назад

    on one side i do mineal calculations with c and c++, then manupulating dom with js, all makes sense except when this context, widget tree come out of nowhere, i've learned how to use this but still lacking the context, i wanna know what's actually happening behind the scene, why these frameworks come out with there own rules, i'm doomed

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

    How do i get the current content of the app?

  • @faheemahmadofficial7701
    @faheemahmadofficial7701 3 года назад +2

    most difficult thing in fluter :(

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

    Love flutter ♥️

  • @meierlink2589
    @meierlink2589 3 года назад +5

    Ну теперь-то всё понятно!!!!!!!!!!!!!

  • @javalover446
    @javalover446 3 года назад

    Flutter is awesome

  • @bankfraud1498
    @bankfraud1498 3 года назад

    Would I wrong by saying this is like having multiple DOMs?

  • @exonent
    @exonent 3 года назад

    Finally!!!!!!

  • @thefamousdjx
    @thefamousdjx 3 года назад

    Nicee

  • @ajayraja6636
    @ajayraja6636 Год назад

    Is createElement like React.createElement in Reactjs?

  • @bezbazz131
    @bezbazz131 3 года назад +1

    Lets Flutter🍴⚡

  • @pnemonic
    @pnemonic 3 года назад

    yes, but what IS IT?

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

    Flutter Grow, Beard Grow.

  • @prashantnigam6698
    @prashantnigam6698 3 года назад

    anyone see dash outside the window it's too funny

  • @Thilina4321
    @Thilina4321 3 года назад +1

    ❤😀

  • @salaheddine6556
    @salaheddine6556 3 года назад

    Heh so what about Getx it doesn't use context

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

    As someone who just started learning flutter, I understood nothing. thanks

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

    I am fluttering!

  • @peruviancode1360
    @peruviancode1360 3 года назад

    Spanish subs please. Nice video

  • @willm127
    @willm127 3 года назад +2

    I still don’t understand what ‘context’ is 😪

    • @filiphracek
      @filiphracek 3 года назад +5

      It's another word for "surroundings". By having access to `context`, your build method can learn stuff like:
      a) what is my parent widget?
      b) how big am I?
      c) is any of the widgets above me a Theme widget?

    • @willm127
      @willm127 3 года назад

      @@filiphracek a response from the man himself! Thank you! That does help!!

  • @David-im1fp
    @David-im1fp Год назад

    Element api does not have parent and children. Thanks.

  • @berozgaarengineer3999
    @berozgaarengineer3999 3 года назад

    flutter webrtc tutorial 🙏🙏

  • @kevinarley6958
    @kevinarley6958 Год назад

    No entendí... 😔

  • @juanpumpkinpie6550
    @juanpumpkinpie6550 3 года назад +1

    bored and over acting videos

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

    I think the buildcontext is one major hindrance that prevents people from adopting flutter.

  • @tantanb2
    @tantanb2 3 года назад

    I don't like flutter build web, it 's terrible!

  • @freakout6764
    @freakout6764 3 года назад

    First

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

    I'm worried.
    - "OMG this is a method, that's so weird!"
    Is this the level they expect from people building apps?