#9 - BLoC 6.1.0 Update - Important Changes, context.watch, context.select & context.read

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ต.ค. 2024

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

  • @Flutterly
    @Flutterly  3 ปีที่แล้ว +5

    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 -> th-cam.com/video/THCkkQ-V1-8/w-d-xo.html

  • @AndreKiller1993
    @AndreKiller1993 3 ปีที่แล้ว +20

    I switched from Provider to Bloc thanks to your videos. Best decision I've ever made!

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว +2

      It's funny I made the same decision about 1 year and a half back haha 😂

    • @vishantjaiswal8146
      @vishantjaiswal8146 3 ปีที่แล้ว +2

      there is no comparision between the two.Provider can be best understood as a dependency injection tool while bloc is a tool for state management. Bloc also uses provider internally.

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว +2

      Yes, Provided is a dependency injection tool, while BLoC is a state management library, which has also the dependency injection feature of Provider "under the hood" !

  • @aurelagbodoyetin3321
    @aurelagbodoyetin3321 3 ปีที่แล้ว +9

    The guy I were waiting for 😂
    Thanks bro 😊

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว +2

      😂 😂 Appreciate it, brother!

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

      Keep helping us improve our bloc skills
      You are the best 👏

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

    Great as usual. From the lasts two videos you've shown a bad uses of bloc, i.e. , programming misconceptions. That's great as we also learn a lot seeing of what not to do. Thanks man.

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

      Thanks, man, indeed, the following videos will again, be mostly about mistakes to be avoided

  • @nhexplorers
    @nhexplorers 2 ปีที่แล้ว +7

    Would love it if you updated this course to Bloc 8 !!

  • @Add0w
    @Add0w 3 ปีที่แล้ว +2

    I updated before but I like to watch those wonderful lectures of u. Thank you very much and keep teaching us these wonderful concepts.

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

      Sorry for taking so long to post, I know you requested the video way back before, but had some others projects to work on. Thanks for the feedback!

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

      @@Flutterly No problem thanks for your time and the wonderful info.

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

    thanks for making it easier to understand the diff between watch and select

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

      You are welcome, mate!

  • @thang1144
    @thang1144 3 ปีที่แล้ว +2

    Thank you for making videos about Bloc, its very helpful and easy to understand

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

      Thank you so much!

  • @babimalas2400
    @babimalas2400 3 ปีที่แล้ว +2

    One of the best flutter channel on TH-cam! Thanks for your hard work man

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

      Really appreciate it, man, thanks! 🌟

  • @faizc359
    @faizc359 ปีที่แล้ว

    Your videos are super easy to understand.

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

    best explanation i have got seen till now, waiting for next video you are really helpful

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

      Thanks a ton! I appreciate it!

  • @Kolano666
    @Kolano666 3 ปีที่แล้ว +2

    Very substantive video. I really like that you are explaining meta issues that cause things to work *that* and not different way. But I have one personal opinion that I like to share. There are too many colorful graphics, icons, arrows etc in your materials that instead of increasing readability of content they overhelm it and start to distract you from whats really important. I believe that - specially in tutor videos - less means more and it would really help if there'd be less slow animations, especially that hand drawing things in the future materials. Cheers.

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

      Yup, I started to remove the hand from tutorial number 12. Thanks for your amazing feedback!

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

    I highly recommend this guy. Just a little focus and magic happends 🔥🔥🔥

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

      Haha, thanks a lot!

  • @timatikgz5310
    @timatikgz5310 3 ปีที่แล้ว +2

    Thank you for your efforts 👍 with picture I understood more effective

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

      I'm glad to hear that! Thanks!

  • @delmontee
    @delmontee 8 หลายเดือนก่อน

    Thanks for the videos. I'm confused though, what's the point of having BOTH BlocProvider.of(context) AND context.read() ? Why two things to do the same thing? IMO BlocProvider.of makes more sense as we use ThemeProvider.of, mediaquery.of, Navigator.of, Scaffold.of etc

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

    Awesome video! Thanks for these good explanations.

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

      Thank you so much! ✨

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

    How is it that final name still works when used with context.select() ?! I thought final means that the value of the variable cannot be changed once it is initialized.
    Or is it now storing a pointer to the location in memory and so now the value can change, but it will point to the same variable in memory ?

  • @АртемВяткин-ъ4ь
    @АртемВяткин-ъ4ь ปีที่แล้ว

    Best bloc tutorial!

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

    What the heck, i always use buildWhen. :) Thank you, I learned new today.

  • @MohamedAbdallah-oh4ux
    @MohamedAbdallah-oh4ux 3 ปีที่แล้ว +1

    Great videos thanks for the explanations. keep up the good work 💪

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

      Thank you a ton! I'll keep them coming!

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

    Will you do videos about API with Bloc?

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว +9

      In the next tutorial series I will start making real world apps with bloc, it's going to be a fun one.

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

      @@Flutterly Yes Start em asap , I don't know I eventually landed on Getx package it has so less boilerplate and easy to learn, bloc seems a no go .....i'd be very happy to learn trueness of bloc as we build real world apps

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

    Idk if I am right Flutterly, but is it ok to change the (context) to (_) of the Builder Widget right? since it will start the lookup in the HomeScreen's context? I tried testing it, it works, but I am not sure if it is the right approach?

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

    This is the series I'm waiting for. This is very useful.. but for every event like increment or selection, have to create each cubit for it.. or can we group by a single cubit? I don't have a clear idea about it.

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

      Unfortunately, I don't understand your question, mate. Can you be more specific?

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

      In your example, a increment and decrement events state events are done in single cubit. Consider in case, an app contains a lots of state events such as increment, displaying date from API, selecting a data from list (like MCQ ) and depend upon showing contents like various state events in flutter app. For all these events have to create own state and cubit for each one or creating a common state and cubit and so can we handle these state changes within it?

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

      The general rule is that you create a cubit for every model, or every feature of your app. For example, if you have authentication feature, you should have an authentication bloc with all its subsequent events and states, if you have a country model, you should have a country bloc in which you can retrieve, fetch, display, populate the UI with countries, that bloc should also have its subsequent states. Having only one bloc/cubit for your entire app is wrong.

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

    thank you bro, I love your lessons

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

      Thank you, brother!

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

    Great video again. What do you know about the 7.0.0 dev version? It says its removing dependency on provider. Does that effect how we write the code or is it just behind the scenes?

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

      Bloc 7.0.0 will be mostly built on the new nu safety Dart, which will probably be released next year or so. Don't need to worry about it right now.

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

    It is going nice with your videos)

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

    Thanks for sharing!

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

    Thanks bro. I have a problem. in the previous video you used two approaches for bloc to bloc communication (stream subscription and bloc listener). and when we toggle between internet, the value of counter increased or decreased. but how can we do this in your new approach? in this video you use builder widget and after that you use two new cotext.watch method for internet cubit and counter cubit. but the problem of code is when we change internet connection the counter value doesn't change in UI! how can we solve this problem? I think we should use context.read().increment() somewhere between line 118 to 148. but how can we do this? or we have to use previous approach (stream subscription and bloc listener)?

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

      It doesn't change because I erased the BlocListener function in the tutorial when I first started coding. Bloc to bloc communication methods remains the same. Either by subscribing to another bloc, or by using BlocListener.

  •  ปีที่แล้ว

    so basicly this destroys the necessity of bloclistener? since it's much simpler syntax to do .watch ?

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

    sir it would be great if you make a series on
    Stack, Transform and Animation Builder Widget
    thanks in Advance
    We need you here sir???

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

    I may seem to be requesting a lot but well explained hydrated bloc (for example can we store token and some objects on it ) and undo/redo functionalities would be nice. thanks bro.

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

      That was exactly what I was about to cover in the next tutorial, haha, we synced our minds pretty well! No problem, bro

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

      @@Flutterly I was wondering if we can use hydrated bloc instead of sharedprefrence for storing token ....to be honest I didnt try it hh.

  • @abdurahmon2827
    @abdurahmon2827 ปีที่แล้ว

    Thank you for such a usefull video

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

    in context.select(BlocA blocA)=> bloc.state.user.name
    my question is how to access this variable if you have many states in your BlocA and not all states have variable name

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

      You could do context.select((BlocA blocA) { if (blocA.state is StateA) return blocA.state.user.name} if only the stateA has an user and a name variable inside.

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

    Thanks men!!! 💪😎

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

      You're welcome, man!

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

    as always the content is great but the tempo of the lecture is extremely fast - please try to slow a bit

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

    Thanks!!

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

      You're welcome, Oguz! Thank you!

  • @kousikambani4499
    @kousikambani4499 3 ปีที่แล้ว +2

    Hey what is going on everyone !!

    • @Flutterly
      @Flutterly  3 ปีที่แล้ว +2

      This is WCKD and today... 😂

  • @-RimuruTempest
    @-RimuruTempest 3 ปีที่แล้ว

    If you have time pls teach us fundamentals of widget tree and element tree.

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

      I covered this topic in my tutorial no. 8, mate, regarding BuildContexts

    • @-RimuruTempest
      @-RimuruTempest 3 ปีที่แล้ว

      @@Flutterly I just watched that, thank you. I thought I watched all the videos😅😅😅 ok then teach us about isolates and background services if you have time

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

    thanks brooo

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

      You're welcome, brother!

  • @ashrafabdo5461
    @ashrafabdo5461 ปีที่แล้ว

    thanx

  • @АлинаВергелес-ш8к
    @АлинаВергелес-ш8к 3 ปีที่แล้ว

    thanks, your tutorials are great!