Тёмный

#8 - BuildContext In-Depth Explanation - Fix BlocProvider.of() fails to find a context containing... 

Flutterly
Подписаться 32 тыс.
Просмотров 36 тыс.
50% 1

Hi there!
Here's the github repository where you can clone all the source code:
github.com/The...
In this tutorial I will introduce you to how Flutter builds the widget tree and how the widget tree is structured and organised by using build contexts. Build contexts are a really, really, really important feature of Flutter and I can bet most of you don't understand it 100% accurate. So today I will talk about how you can manually build the widget tree by yourself, along with all the widgets and their specific build contexts. I'll also show you how BlocProvider.of(context) works in order to lookup for a BlocProvider widget inside the widget tree. We'll see, understand and fix the well-known BlocProvider.of() fails to find a context containing a specific bloc/cubit error, and many many more!
All animations were done in VideoScribe, you can try it by clicking my affiliate link --- www.awin1.com/...
You can contact me directly here:
Join my Discord Server --- / discord
Twitter --- / letsgetwckd
Instagram --- / letsgetwckd
Also, if you want to support me furthermore you can become an RU-vid Member, donate or buy my courses on Udemy, using the following links:
Become an Official RU-vid Member! ---- / flutterly
Buy my Udemy Courses! ---- www.udemy.com/...
Support me on Revolut! ---- revolut.me/let...
Buy me a Ko-fi! --- ko-fi.com/wckdyt
Donate me on Paypal! --- www.paypal.me/...
Support me on Patreon! --- / wckdyt

Опубликовано:

 

26 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 217   
@Flutterly
@Flutterly 3 года назад
Hello, everyone! The entire course is now live on Udemy too, get it while it's hot --> www.udemy.com/course/bloc-from-zero-to-hero/?referralCode=E689592633984B34DBEF Also I have just managed to finally finish the entire BLoC - From Zero to Hero Complete Course, based on this tutorial series. You can check it out here -> ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-THCkkQ-V1-8.html
@lindermannla
@lindermannla 3 года назад
The best explanation about BuildContext I've seen so far! Congratulations!
@Flutterly
@Flutterly 3 года назад
You're welcome! I am glad I helped!
@morphingcoffee
@morphingcoffee 3 года назад
Watched several BuildContext explanation videos on RU-vid, and most of them were just scratching the surface, and merely advising how devs can work around the gotchas without providing under-the-hood understanding of it. Thanks, appreciate how detailed you went over this!
@Flutterly
@Flutterly 3 года назад
Glad I could help, man! ✨ 🥂
@dnlbrock
@dnlbrock 3 года назад
Man, many thanks. You've made my development fun - I can now say I'm familiar with Bloc and I not fighting anymore with my code.
@Flutterly
@Flutterly 3 года назад
You're welcome, man! I really appreciate that my videos helped you become a better developer!
@shashan5900
@shashan5900 3 года назад
Same
@mohammedabdulhady8926
@mohammedabdulhady8926 2 года назад
This playlist is such a gem.. Even though the code in some videos is a little outdated, the concepts are very well explained, and I always find myself coming back for a revise.
@abdulhamidyusuf2848
@abdulhamidyusuf2848 3 года назад
No way man! I had a really hard time understanding this concept, but this explanation is unique and easy to comprehend. Thank you
@Flutterly
@Flutterly 3 года назад
Thank you so much! ✨
@divyanshukumar1329
@divyanshukumar1329 Год назад
i just fixed my crashing app just after this 23:18 minutes tutorial on context. Thanks you WCKD, Stay motivated and keep posting such rich content
@gurkanfg
@gurkanfg 3 года назад
For a long time. I am working on dart language. And at the same time, I produce products, trainings and content in my own country. I would like to say as a member of the Google Developer Community. Your content helped a lot with the projects I developed. Appreciation of the quality of the contents and the work in the preparation process. Keep going like this.
@Flutterly
@Flutterly 3 года назад
Thank you so much, I really appreciate your feedback! ✨
@deveshkharade3489
@deveshkharade3489 9 месяцев назад
This Tutorial series is first where i understood bloc very well Thanks
@userwill1005
@userwill1005 Год назад
It was a the best explanation of BuildContext. Now I have clarity in mind about buildContext.
@benedictadu1254
@benedictadu1254 2 года назад
This is the best explanation of how to build context works with Bloc that I have seen so far. Excellent work done. I hope you receive much more support in future for this.
@minhan4444
@minhan4444 5 месяцев назад
The tutorial is not only to learn about Bloc concepts but also to learn about BuildContext in Flutter core concepts. Thank you very much :3
@TheGaoNan
@TheGaoNan 3 года назад
Best explanation on RU-vid, thank you!
@Flutterly
@Flutterly 3 года назад
Thanks a lot! I appreciate your feedback!
@datobarbaqadze6553
@datobarbaqadze6553 3 года назад
I have watched terribly many explanations not only about buildcontext but many other things, I can surely say that this channel is the best one on youtube. Love it, keep it up man
@progtom7585
@progtom7585 7 месяцев назад
this is priceless, thanks so much. I was having a context nightmare with BloC after migrating from riverpod and was trying to avoid a side project because of it. Youve put me back on track. Great video series, thanks very much.
@mengyan3214
@mengyan3214 2 месяца назад
What a fantastic explanation of BuildContext. Thank you so much for sharing.
@shubhammittal2367
@shubhammittal2367 3 года назад
Finally get cleared my all doubts regarding context.thanks a lot sir
@Flutterly
@Flutterly 3 года назад
All the best!
@sibulelemboyi526
@sibulelemboyi526 3 года назад
Wow! Thanks, I finally got a clear explanation of BuildContext. You are great!
@Flutterly
@Flutterly 3 года назад
I'm really glad! ✨
@abhijitpani3438
@abhijitpani3438 3 года назад
Yours is the first channel I have subscribed in my youtube life. You are gifted! Would you mind sharing which video making tool do you use? I will try it in my office presentations
@SIDDARTHBHURA
@SIDDARTHBHURA 3 года назад
Best explanation on BuildContext. Thank you
@michaelmocan
@michaelmocan 3 года назад
Love your work! This crucial topic is overlooked by all flutter tutorials I've seen so far.
@nhexplorers
@nhexplorers 3 года назад
Best flutter tutorials I’ve ever seen. Thanks for explaining the details in such a clear and concise manner
@Flutterly
@Flutterly 3 года назад
Thank you so much for this detailed, positive feedback! I really appreciate it!
@aldiirsanmajid4235
@aldiirsanmajid4235 3 года назад
thanks for this playlist about bloc, it make me easier to learn it, keep it up man.... I will wait for another tutorial playlist from you
@sasanpormah52
@sasanpormah52 3 года назад
Wow you are amazing, I was confused why I received this error and now I know why. Thanks a lot.
@Flutterly
@Flutterly 3 года назад
Thank you, brother 🤍
@armandguanlao7973
@armandguanlao7973 3 года назад
Hi, I just wanna say that I really appreciate what you're doing here. I've binge watched all your previous videos up to here and have made sure to like all of them atleast as a show of gratitude :D I really like the way you explain and visualize the concepts that's very easy to understand and follow through. I was actually researching about this topic for a while and stopped since I cannot grasp it properly then. Watching your videos made me confident about it now and in turn made me feel positive and happy. I was actually really excited when I was talking about your videos to someone and even said that the ability for it to teach is very good and could actually be a worth-it paid course, if ever. Keep up the great work! You've really improved a lot.
@Flutterly
@Flutterly 3 года назад
Thank you so much for your kind words, man! I really appreciate the positive feedback you gave me! I'll struggle to give you and my viewers the best tutorials! I'm glad you think I have improved over time! Thanks a lot again and hope I'll see you soon in the comments section of newer vids!
@armandguanlao7973
@armandguanlao7973 3 года назад
You deserve it! I was actually a little sad that I've seen everything up to this point that I have nothing else until your next one - in a good way that is. It's like a good TV show that you just wanna see the next one as soon as possible. :D I'm looking forward to them. Keep safe also!
@Flutterly
@Flutterly 3 года назад
Thank you so much! ✨ I prefer quality over quantity so that's why it's taking so much time to post tutorials
@Smimo-bx2ir
@Smimo-bx2ir Год назад
This is Actually the best explanation of BuildContext. Thank you so much
3 года назад
Thank you for this great tutorial. I am looking forward to see tutorials for another topics too.
@Flutterly
@Flutterly 3 года назад
Thank you so much!
@mallikarjunreddy5229
@mallikarjunreddy5229 3 года назад
Yup, Shared it with on of my mate, who joined recently to work along with me on existing project built with bloc. Hopefully he will learn quickly(hopefully my mate won't take much time as I took to understand bloc in my initial days 😜) and will get fair idea on what's going on. Thank once again ❤ Looking ahead for more advance videos.
@Flutterly
@Flutterly 3 года назад
Thank you!
@ahmed_alharthi
@ahmed_alharthi 3 года назад
Developer need to be aware all time with this context thing. Flutter supposed to be easy 😅. I really enjoyed and learned a lot from the videos. Thank you.
@Flutterly
@Flutterly 3 года назад
Indeed, that's why I considered it so be a really, really important tutorial! Thanks!
@syaefulamri411
@syaefulamri411 3 года назад
easy to understand the best explanation so far
@Flutterly
@Flutterly 3 года назад
Thank you so much! ✨
@sabahmohamed8617
@sabahmohamed8617 5 месяцев назад
Omg i have just found a treasure.thank u for the wonderful easy explanation i think i will watch all your videos now❤️❤️❤️❤️
@bkyuch
@bkyuch 3 года назад
This video and your way of explaining things are so underrated. You've got my subscription and thanks for doing this work. I learned a lot and it was awesome :)
@Flutterly
@Flutterly 3 года назад
Thank you so much for your kind feedback, mate! I appreciate every word you said and I couldn't be happier to help you in pursuing the level of understanding bloc!
@michaelmocan
@michaelmocan 3 года назад
I agree. He should make a course on how to teach technical subjects.
@philroger8773
@philroger8773 5 месяцев назад
Good sir, you make me understand how build context works.. Thank you so much..
@poomchantara355
@poomchantara355 3 года назад
This video should be added to the Bloc documentation. LIKED and SUBSCRIBED!.
@Flutterly
@Flutterly 3 года назад
Thank you so much! ✨
@TechWithDnes
@TechWithDnes 3 года назад
The playlist is there in the bloc documentation. :)
@chaincse
@chaincse 3 года назад
Thanks, WCKD. Must watch and needed one!!! I personally addict to bloc and your videos as well. Keep rocking!!!
@Flutterly
@Flutterly 3 года назад
Nice to hear that, mate! 🌟 Thanks a ton!
@rahulagarwal7369
@rahulagarwal7369 3 года назад
One of the best explanation on Build context. Wonderful work
@Flutterly
@Flutterly 3 года назад
Thank you so much! ✨
@muhammadshahzadakram7742
@muhammadshahzadakram7742 3 года назад
Hey, WCKD, I Started learning flutter recently, and to be honest, I was having a really tough time understanding how this whole BLoC thing worked till now. I Love how you illustrate each concept pictorially. Huge Fan or your teaching. I would appreciate an example of BLoC with Forms and to be specific, An Entire Login Flow. Thanks.
@Flutterly
@Flutterly 3 года назад
For sure I'll do that in the future, man, after I finish all these tutorials!
@muhammadshahzadakram7742
@muhammadshahzadakram7742 3 года назад
@@Flutterly much appreciated 💞
@kutayyildirim4074
@kutayyildirim4074 2 года назад
Thank you for everything. I was struggling about learning BLoc but I understand most of the logic behind the scenes now. Best explanation :)
@rohithk5234
@rohithk5234 3 года назад
best explanation of contex and flutter 🔥🔥🔥🔥
@Flutterly
@Flutterly 3 года назад
Thanks a lot!
@ujjwalbiswas8400
@ujjwalbiswas8400 3 года назад
This level of details in a tutorial, And i wonder how much hardworking you put to make this video. Thank you again.
@Flutterly
@Flutterly 3 года назад
About 1-2 weeks of work for a tutorial
@ujjwalbiswas8400
@ujjwalbiswas8400 3 года назад
@@Flutterly That's lots of time , Thanks WCKD for these tutorials, waiting for more of your tutorials in future. Love
@Flutterly
@Flutterly 3 года назад
You're welcome, mate! I'm really happy you like them!
@yaddiaby1504
@yaddiaby1504 3 года назад
@@Flutterly thx a lot
@JohnLandicho
@JohnLandicho 2 года назад
You're sooo good, thank you so much, I never really understood context before this video
@MrVlat456
@MrVlat456 3 года назад
This is the best explaination of BuildContext ever far.
@Flutterly
@Flutterly 3 года назад
Thank you so much! ✨
@kakajanoa4260
@kakajanoa4260 3 года назад
A lot of thanks man, I hope, you will continue create tutorial videos in this context). I'm waiting for another videos about flutter
@Flutterly
@Flutterly 3 года назад
Thank you, man! Appreciate it!
@bensubendran
@bensubendran 3 года назад
This is more informative than all the other explanations. Thanks Flutterly
@Flutterly
@Flutterly 3 года назад
Thanks, Ben! I appreciate it!
@islomkhujaakhrorov6668
@islomkhujaakhrorov6668 3 года назад
It is one of the important topic that you presented to us Thank you man
@Flutterly
@Flutterly 3 года назад
Thank you so much, man!
@tareksellami7346
@tareksellami7346 3 года назад
Mind blown 🤯🤯. You make everything look easy ❤❤
@arnaudduquenoy2061
@arnaudduquenoy2061 3 года назад
... i was searching that « buildcontext » video since a while :) thanks Wckd !
@Flutterly
@Flutterly 3 года назад
I'm glad I could help you, bro! You're welcome!
@ahmedzaydan3521
@ahmedzaydan3521 9 месяцев назад
Really really GREAT and PERFECT explanation Thank you from my heart ❤❤❤
@noshingh521
@noshingh521 3 года назад
You explain amazingly! Very complete and concise. you deserve million subscriber and I hope continue your work. Thank you sir 🌷
@Flutterly
@Flutterly 3 года назад
Thank you so much! Hopefully I'll get there someday! I appreciate it! ♥
@mkhwanazicebo4448
@mkhwanazicebo4448 3 года назад
Thank you so much for this video, please continue to make more. I really love the way you explain everything in detail.
@Flutterly
@Flutterly 3 года назад
Thank you so much, brother! I will!
@rohitsrao
@rohitsrao 2 года назад
This was awesome! Thank you so much. Love this entire series and especially all the hard work it took to painstakingly create the animations.
@skypuff
@skypuff Год назад
This man is absolutely incredible.
@md.ruhulamin7963
@md.ruhulamin7963 3 года назад
Thank you sir. Please make a complete project using BLoC pattern.
@Flutterly
@Flutterly 3 года назад
I will make a complete series building different apps!
@bijendernagar15
@bijendernagar15 3 года назад
Best teacher great explained by simple and deeper pls make more video with firebase love from India ❤️
@nidalbakir4720
@nidalbakir4720 3 года назад
I appreciate your efforts and time to make such a great video. Thanks WCKD💙💻👓
@Flutterly
@Flutterly 3 года назад
It's WCKD, mate, thanks! 🌟
@Your_mom_calls_me_luka
@Your_mom_calls_me_luka 11 месяцев назад
GOATED Explanation man.
@enigma_i_am
@enigma_i_am 3 года назад
Man your videos are awesome... I really hope you do something on RXdart
@Flutterly
@Flutterly 3 года назад
Will do in the future
@raul286162
@raul286162 3 года назад
Bro, I
@Flutterly
@Flutterly 3 года назад
Haha, thank you so much, brother! I really appreciate all your kind words! Hope you'll stay here on this channel furthermore, cause more awesome series will come in the future!
@jjsportify77
@jjsportify77 3 года назад
Man! Keep up the good work! Love your tutorials. Please make more videos like this!
@Flutterly
@Flutterly 3 года назад
Thank you so much! ✨
@prajunmagar4694
@prajunmagar4694 2 года назад
Thank you for explaining in-depth concept of BuildContext and widget tree, really loved your work! Could you also please make a tutorial for the element and render tree too?
@nazimjoli2406
@nazimjoli2406 3 года назад
your explanation are amazing 🤩
@Flutterly
@Flutterly 3 года назад
Thank you so much, mate! 🌟
@OusseynouDIAGNE-wu1gg
@OusseynouDIAGNE-wu1gg 5 месяцев назад
This tutorial is really helpful ! Thanks a lot ! I like it .
@vinayTshetty
@vinayTshetty 7 месяцев назад
OMG that great work and Good animation to understand. thanks for the tutorials.
@mohammedrashad1
@mohammedrashad1 7 месяцев назад
Thanks, I think your channel is one of the best
@user-sc7tq2di7q
@user-sc7tq2di7q 3 года назад
Greeeeeeat, It answers all my question, Thank you ❤️️
@ketan_sahu
@ketan_sahu Год назад
Such a wonderful explanation!!
@nadeemshahzad4416
@nadeemshahzad4416 3 года назад
Amazing explanation .....
@rp2804
@rp2804 3 года назад
Once a legend said, ''The only way is UP"!
@Flutterly
@Flutterly 3 года назад
Up in the sky 👆 🌟 😂
@adnanalshami3751
@adnanalshami3751 3 года назад
Super useful. Thanks
@Flutterly
@Flutterly 3 года назад
Thank you!
@WiLL-by5sw
@WiLL-by5sw 3 года назад
Thank you so much again man! Again! Another awesome tutorial!! :D
@Flutterly
@Flutterly 3 года назад
My pleasure!
@kehindeoyewale6983
@kehindeoyewale6983 3 года назад
Thank you for releasing this video, it was really helpful and educating
@Flutterly
@Flutterly 3 года назад
You're welcome, man, thank you!
@batuhankrbb
@batuhankrbb 3 года назад
It made me even more confused :D I need to watch it again
@batuhankrbb
@batuhankrbb 3 года назад
*not because of the problem of the tutorial
@user-dj2vx6nb5h
@user-dj2vx6nb5h 2 года назад
This is the great explanation 😍🔥
@officialismailshah
@officialismailshah 2 года назад
always amazing content, respect man for your struggle🙌🙌🙌
@yaqub3567
@yaqub3567 2 года назад
Maaaaaaaaan! That was Amazing explanation
@dhruvsoni9929
@dhruvsoni9929 Год назад
You've made an Absolutely Great Video 👍✨
@hatemragab2902
@hatemragab2902 3 года назад
thanks, bro hope you make videos using API with bloc
@Flutterly
@Flutterly 3 года назад
Sure thing in the future
@aurelagbodoyetin3321
@aurelagbodoyetin3321 3 года назад
Welcome back 🙂 Thks for your videos
@Flutterly
@Flutterly 3 года назад
Thank you! Sorry for the delays, this video took over 2 weeks to be made!
@aurelagbodoyetin3321
@aurelagbodoyetin3321 3 года назад
It's worth it. The content is understandable as always. Nice video
@dilshan3372
@dilshan3372 3 года назад
Again Great video , Thank you so much....
@Flutterly
@Flutterly 3 года назад
You're welcome, thanks!
@fabiocarvalho9602
@fabiocarvalho9602 6 месяцев назад
You are trully wicked sir Do you have any more content about Flutter?
@bodehallak1552
@bodehallak1552 3 года назад
great explanation, really helpful tutorial. thank you very much, keep going please we're supporting you. :3
@Flutterly
@Flutterly 3 года назад
Thank you so much for your support, it is greatly appreciated!
@hassanhassanzadeh2161
@hassanhassanzadeh2161 2 года назад
thank you bro for teaching bloc
@mohamedsaleh9046
@mohamedsaleh9046 10 месяцев назад
very good explanation, thanks
@kareemabuelyousr7503
@kareemabuelyousr7503 2 года назад
Thanks so much for the magnificent explanation, but I have a question : In the last 5 minutes of the video when you gave the 3 examples, you put the BlocProvider's context as "_" which means that it will make the context anonymous like you said and that's why the .of's context will start searching from the build's context. But what if we changed the context of BlocPovider from "_ " to "context" for example. Now, the BlocProvider doesn't have an anonymous context anymore and thus the .of's context will start searching from the BlocProvider's context (because it's not anonymous anymore) and therefore, there will be no error as it will find the BlocProvider immediately and thus we don't need to wrap RaisedButton widget with Builder widget anymore !! So, my question here is what I'm saying is right or not ?
@kennethburla
@kennethburla 3 года назад
This is some great quality content. You're awesome. Thanks
@abdulrahmanal-fakih3996
@abdulrahmanal-fakih3996 2 года назад
Great explanation. Keep it up!
@huyle259
@huyle259 3 года назад
what a nice tutorial, thank you so much
@jontysingh4334
@jontysingh4334 2 года назад
Great video learnt a lot from your videos
@Pedro5antos_
@Pedro5antos_ 2 года назад
AWESOME content! Big thanks
@rezaesfandiari1865
@rezaesfandiari1865 3 года назад
Thanks very much
@gmmome2073
@gmmome2073 4 месяца назад
best explanation. thanks.
@akliatharia
@akliatharia 3 года назад
thnks man great stuff as usual
@Flutterly
@Flutterly 3 года назад
Thank you, man!
@vinixmendez
@vinixmendez Год назад
excellent tutorial thank you very much for teach me this
@StefanoV827
@StefanoV827 3 года назад
Amazing! One question about the drawing: Why CounterCubit context is child of InternetCubit in the tree? I thought the tree was: MyApp > MultiProvider > MaterialApp ... The 2 cubits are not child because they instanciate a new context as create param, so they are not child of the MyApp context in that drawing (or if we have to include them, we can put them on the same level with MaterialApp). Maybe i'm lost sorry :\
@Flutterly
@Flutterly 3 года назад
No, you're not right. As I mentioned inside the tutorial, what MultiBlocProvider(BlocA,BlocB,BloC) does is actually a way of writing BlocA > BlocB > BlocC inside the widget tree. So, in our case, it's MyApp > MultiBlocProvider(InternetCubit,CounterCubit) > MaterialApp, but MultiBlocProvider(InternetCubit,CounterCubit) behind the curtains translates into InternetCubit > CounterCubit, therefore the widget tree is MyApp > MultiBlocProvider (which needs to be written because it is the thing that wraps out next cubits) > InternetCubit > CounterCubit > MaterialApp. You should watch the entire tutorial and you'll understand better why it's this way.
@StefanoV827
@StefanoV827 3 года назад
@@Flutterly Thank you for the answer. I will rewatch it again :D
@mohamedhamde6611
@mohamedhamde6611 2 года назад
Thank you very much for your effort .
@desnshanji2615
@desnshanji2615 2 года назад
Thanks so much for your tutorials. Quick question though. Instead of adding Builder(context) on RaisedButton, can adding a context in the BlocProvider be enough to see the context? Such as BlocProvider( create: (context)=> BlocA(), child: RaisedButton…..
@ramkishoreprajapati1325
@ramkishoreprajapati1325 19 дней назад
Oh, My god, you are so great.
@zineddine_haddad
@zineddine_haddad 3 года назад
A lot of thanks wckd
@Flutterly
@Flutterly 3 года назад
You're welcome, man!
@zakariyaetouzi7967
@zakariyaetouzi7967 3 года назад
Thanks, you are the 👍 best
@Flutterly
@Flutterly 3 года назад
Thank you! 🌟
@-RimuruTempest
@-RimuruTempest 3 года назад
when will you post your next video? i am eagerly waiting!
@Flutterly
@Flutterly 3 года назад
Most probably tomorrow or the day after tomorrow, it takes a ton of time to make them and I also have multiple other projects I'm currently working on so time is my biggest enemy right now, haha 😂
Далее
I Took a LUNCHBAR OFF A Poster 🤯 #shorts
00:17
Просмотров 2,1 млн
Understanding BuildContext in Flutter
12:26
Просмотров 31 тыс.
microsoft doubles down on recording your screen
10:00
When RESTful architecture isn't enough...
21:02
Просмотров 272 тыс.
What is BuildContext | Decoding Flutter
12:23
I've been using Redis wrong this whole time...
20:53
Просмотров 354 тыс.