Flutter Bloc Tutorial - Bloc or Cubit?

Поділитися
Вставка
  • Опубліковано 4 вер 2022
  • In this video you'll learn about the Bloc Library, Blocs and Cubits, and how to use Blocs in your Flutter application.
  • Наука та технологія

КОМЕНТАРІ • 17

  • @hermionegreen333
    @hermionegreen333 8 місяців тому +1

    this is very useful info, thank you!

    • @BradCypert
      @BradCypert  8 місяців тому

      Glad it was helpful!

  • @merwen1
    @merwen1 Рік тому

    Thank You 💯

  • @jakest.germain2475
    @jakest.germain2475 Рік тому +1

    Would you recommend Blocs for those that are new to working in Flutter? I can see the easier traceability and testing/mocking to be helpful for a new Flutter Dev but, most likely, the app will be simple so that may be an argument for Cubits.

    • @BradCypert
      @BradCypert  Рік тому +1

      The structure of blocs helps me plan and reason with my code's flow so I greatly prefer them to cubits but I do think for small apps, cubits can work just as well. When I first started building the project I showed at the end, I had actually used Provider (another state management solution) and rolled my own "view model" type approach. What I ultimately found is that I had done several things wrong and there were pretty significant performance applications with my approach -- which ultimately prompted me to give Bloc a shot.
      All this to say: You are probably fine with Bloc, Cubit, Provider or anything else as long as you're structured with it and fully understand how it works. As for a recommendation, I'd start with cubits if you want to use Bloc (the package) and evaluate regularly how its going.

  • @karanparmar298
    @karanparmar298 Рік тому +1

    Can we create generic bloc or states so we don't have to define that loading loaded and failure state in every bloc?

    • @BradCypert
      @BradCypert  Рік тому

      You can define a generic state and event, if you’d like! You’d just need to handle that as you would the non-generic classes

  • @quicksketch1617
    @quicksketch1617 Рік тому +2

    Hi, I`ts very good your tutorials, do you plan to make more videos showing bloc examples app?

    • @BradCypert
      @BradCypert  Рік тому +2

      I certainly can! I’ve been making a list of some things that I think I’d be good at covering. I’ll add more Bloc stuff to the list!

  • @mob_app_devss
    @mob_app_devss Рік тому

    What should choose

    • @BradCypert
      @BradCypert  Рік тому

      Whatever makes the most sense for your team given the context they’re operating in!
      If that’s not helpful though, I’d recommend starting with Bloc and giving that a try first!

  • @benny-shen
    @benny-shen Рік тому +1

    what about riverpod

  • @kartavyabagga
    @kartavyabagga Рік тому

    Any Link For This Project ?

    • @BradCypert
      @BradCypert  Рік тому +1

      This is actually a private project of mine that I attempt to live off of so the source is not available here. Sorry!

    • @kartavyabagga
      @kartavyabagga Рік тому

      @@BradCypert No worries i completely agree on this👍🏻