Riverpod or Bloc? Which One is Better?

  Рет қаралды 48,260

Flutter Guys

Flutter Guys

Күн бұрын

Пікірлер: 92
@RandalLSchwartz
@RandalLSchwartz Жыл бұрын
I believe bloc is the right choice when you're working on a team of varying skill levels. It has one primary way of distributing events, and everything sorta circles around that. Riverpod offers far more flexibility... but with great power comes great responsibility, and some mastery is recommended. Riverpod can even be used in "bloc" mode with streams if you want... That said, I reach for riverpod for pretty much every project I'm influencing, whether it's a few classes, or a few hundred classes. Riverpod scales well.
@zdenekkrcal9066
@zdenekkrcal9066 Жыл бұрын
Riverpod is excellent and easier to use now with riverpod annotations.
@abrorbobomurodov2361
@abrorbobomurodov2361 Жыл бұрын
Bloc is so easy if you use freeze package with bloc
@吳建儒-o5t
@吳建儒-o5t Жыл бұрын
@@abrorbobomurodov2361 Riverpod can too.
@Cpmbc279
@Cpmbc279 Жыл бұрын
YES!
@RandalLSchwartz
@RandalLSchwartz Жыл бұрын
Riverpod *has* a StreamProvider. Most of riverpod has nothing to do with streams, and uses a far simpler but more flexible strategy of ProviderListenables. So the comment mid-video about them both using streams is already wrong. Some of the other things are also marginal.
@noursalman932
@noursalman932 Жыл бұрын
Coming from BLoC (Cubit) background, I actually learned to use Riverpod from this comparison, better than any Riverpod tutorial I came across. Many thanks!
@flutterguys
@flutterguys Жыл бұрын
❤✌
@moisesbinzie
@moisesbinzie Жыл бұрын
Well explained. With that comparison, I finally understood a bit of Bloc. Coming from Provider, It was easy for me to transtion to Riverpod than Bloc
@kairos_moments
@kairos_moments Жыл бұрын
true
@akshattamrakar9071
@akshattamrakar9071 Жыл бұрын
Bloc is better as it extracts all the implementation in separate location. It's works great for teams
@sahilambure
@sahilambure Жыл бұрын
It is good for beginner to advance app. But riverpod scales better than BLOc
@abrorbobomurodov2361
@abrorbobomurodov2361 Жыл бұрын
​@@sahilamburefor team work Bloc would be great choice
@conceptcoder
@conceptcoder Жыл бұрын
It's like "Fireship taste" when see this video... 😎
@TheRealPhillipJacobs
@TheRealPhillipJacobs Жыл бұрын
Haha I thought the same!
@sharbelokzan9673
@sharbelokzan9673 Жыл бұрын
I’m experienced with bloc but was a bit confused with riverpod, this helped a lot! Thanks
@flutterguys
@flutterguys Жыл бұрын
Glad it helped!
@Quicky121
@Quicky121 Жыл бұрын
I tried Cubit, BLoC and (sadly) Redux and for me BLoC is the better. It has a clean way to write your business logic and all the Builder, Listener widgets keep your code clean. I read some comments that says that Riverpod scales up better and I'm curious to see if it's true. Maybe an hint for next video? :P Thanks for the video!
@flutterguys
@flutterguys Жыл бұрын
noted.
@robbrooks5263
@robbrooks5263 Жыл бұрын
Explain to me like I'm a 5 year-old why I need to adopt one of these in preference to plain old Provider. What am I missing?
@TheRealPhillipJacobs
@TheRealPhillipJacobs Жыл бұрын
Probably just the size of your app.
@RandalLSchwartz
@RandalLSchwartz Жыл бұрын
I've migrated three projects from Provider to Riverpod. Each time, the code get simpler, more robust, and more featureful, and easier to maintain.
@sahilambure
@sahilambure Жыл бұрын
Riverpod is better for big apps.
@jointtask
@jointtask Жыл бұрын
Bloc has a lot of boilerplate code involved, I wound prefer Riverpod
@justinprakashraj6256
@justinprakashraj6256 Жыл бұрын
what is boilerplate ?
@baruchfavour9358
@baruchfavour9358 Жыл бұрын
Much of code could be unnecessary sometimes
@justinprakashraj6256
@justinprakashraj6256 Жыл бұрын
@@baruchfavour9358 thanks BFavour
@鄭琮瀚-x2j
@鄭琮瀚-x2j Жыл бұрын
How about getx?
@Quicky121
@Quicky121 Жыл бұрын
I don't know man, it has some boilerplate but for events and state you can use freezed library to solve this, resulting in less boilerplate and cleaner code. Give it a try!
@fegartyx8271
@fegartyx8271 Жыл бұрын
I'm still confused right now, like many job requirements want to use bloc than riverpod
@przemekbemek
@przemekbemek Жыл бұрын
Great comparison, thanks. I found a minor bug in 1:25 on the right example - "state.user == null" is copy-pasted from the left example, but there's no reference to state actually
@flutterguys
@flutterguys Жыл бұрын
Yes you are right, Thank you ❤✌
@letmelearnai
@letmelearnai Жыл бұрын
i only use riverpod now since i found provider lack context control. i'll try bloc when i found lack of riverpod because people said bloc is great for complete separate business logic.
@flutterguys
@flutterguys Жыл бұрын
✌❤
@guycz
@guycz Жыл бұрын
My opinion - Riverpod
@TheRealPhillipJacobs
@TheRealPhillipJacobs Жыл бұрын
Looks like Riverpod is the winner in the comments. Riverpod it is then!
@MarcelinoDavid111
@MarcelinoDavid111 9 ай бұрын
Riverpod
@ragibshahariar3169
@ragibshahariar3169 2 ай бұрын
Hello Flutter guys could you teach us bloc. how to implement it
@nicolaimagnussen1914
@nicolaimagnussen1914 4 ай бұрын
which editing tricks are you using to get this type of editing, any tips?
@davisburnside9609
@davisburnside9609 11 ай бұрын
Why would I want bloc a river as no competing pods are crossing state crosspods?
@YS_Yousef
@YS_Yousef Жыл бұрын
please make the soundeffects lower and get some better ones
@tananga_studio
@tananga_studio Жыл бұрын
From my expierience riverpod is more elastic. Bloc is good in simple apps
@NOBODYxx09
@NOBODYxx09 Жыл бұрын
No, bloc is the choice for bigger apps believe me i have been there 😉
@bouyahyabilel2437
@bouyahyabilel2437 Жыл бұрын
No , bloc is the great choice for bigger app , also when you work with team
@site.x9448
@site.x9448 10 ай бұрын
Wow. Sir, what software do you use for such editing?
@pintalubaf
@pintalubaf Жыл бұрын
The main problem I see with Riverpod is that anyone, from anywhere, can read a notifier and change the state,
@flutterguys
@flutterguys Жыл бұрын
Riverpod document : Do not be frightened by the global aspect of providers. Providers are fully immutable. Declaring a provider is no different from declaring a function, and providers are testable and maintainable.
@pintalubaf
@pintalubaf Жыл бұрын
@@flutterguys Yeah, providers are immutable, but their states are mutable, and public. I'm not saying it's bad, it's just the problem I see.
@RandalLSchwartz
@RandalLSchwartz Жыл бұрын
@@pintalubaf "but their states are mutable, and public.". No, they aren't. You must pass through a function to update the state of a Notifier (sync, Future or Stream). If you're calling that mutable or public, you need to look closer. Perhaps you're thinking of the legacy StateProvider, which was a stopgap introduced to get people at least one step away from globals. But that pattern while still supported, is no longer recommended. Instead, immutable state with defined updating methods is now the primary API.
@pintalubaf
@pintalubaf Жыл бұрын
@@RandalLSchwartz This is actually good news to me, because some months ago I could set the state from anywhere like: `ref.read(randomProvider.notifier).state = newState;`, so at that point, either state was mutable/public or not protected. It's good to see its immutable now. Thank you for letting me know about this.
@pintalubaf
@pintalubaf Жыл бұрын
Or, it's the legacy StateProvider as you said.
@algeriennesaffaires7017
@algeriennesaffaires7017 Жыл бұрын
Even i have been developing with flutter for 4 years, but i can't understand this video. The correct question is, what is the problem block or provider solve, and set State can't do it? Im using set State, and it's good enough
@flutterguys
@flutterguys Жыл бұрын
In big apps, you cannot use set state to manage the state, and you need to manage the structured state and avoid complexity.
@algeriennesaffaires7017
@algeriennesaffaires7017 Жыл бұрын
@Flutter Guys thanks, i have a medium-sized app that took me 4 years now to maintain i ts little complicated, yes, but it's well controlled with just set State
@bhakinkhantarjeerawat8163
@bhakinkhantarjeerawat8163 Жыл бұрын
@@algeriennesaffaires7017 Interesting! I really like when people can use simple methods to manage things, especially the old staff, and it still works well.
@sangamgiri1071
@sangamgiri1071 Жыл бұрын
Yes I have used default setState in bigger projects too but at some point everything starts getting messy so Bloc is recommended
@teajay6545
@teajay6545 Жыл бұрын
I can only imagine the pain and length you have to go through to make your apps conform to using setState only phew 😮‍💨 (I smell anti-pattern)
@alphaNaj
@alphaNaj Жыл бұрын
great content you are making, keep it up
@flutterguys
@flutterguys Жыл бұрын
Thanks, will do!
@rsajdok
@rsajdok Жыл бұрын
riverpod has less boiler plate code
@abasilis
@abasilis Жыл бұрын
Hi, Excellent video, thanks. At the end you mentioned depends on the scale of the peoject, so, which one to use in a bigger project?
@flutterguys
@flutterguys Жыл бұрын
Blo
@flutterguys
@flutterguys Жыл бұрын
Bloc
@abasilis
@abasilis Жыл бұрын
@@flutterguys Thank yoy very much!
@dadlord689
@dadlord689 7 ай бұрын
Working for years with Unity and Unreal engines... this is frustrating. You can't over complicate messaging more.
@h3w45
@h3w45 6 ай бұрын
Thank you very well explained
@dolbysoundsofficial9323
@dolbysoundsofficial9323 Жыл бұрын
Riverpod
@erlangparasu6339
@erlangparasu6339 Жыл бұрын
bloc because more recognize with all class contains prefix "Bloc" :)
@justinprakashraj6256
@justinprakashraj6256 Жыл бұрын
BLOC 🔹❤️
@joshuanwokoye
@joshuanwokoye Жыл бұрын
Very straight forward!
@mohamedabdelrehem7698
@mohamedabdelrehem7698 Жыл бұрын
are you real this video the first of your videos pop to me and now i just watched mostly all of your videos♥♥♥♥
@flutterguys
@flutterguys Жыл бұрын
Glad it was helpful!
@miranantamiangr
@miranantamiangr Жыл бұрын
You have to change your voiceover ai to elevenlabs or something slower. It’s very bad and rushed now
@IncompleteTheory
@IncompleteTheory Жыл бұрын
Provider FTW.
@int-64
@int-64 4 ай бұрын
Too much coupling and logic in the UI with Riverpod. Bloc provides good abstraction and decoupling
@bilal1708
@bilal1708 10 ай бұрын
I prefer Provider 😅
@TheRealFFS
@TheRealFFS Жыл бұрын
You want to go over this any faster pal?
@flutterguys
@flutterguys Жыл бұрын
What do you mean?
@markosunbro2732
@markosunbro2732 6 ай бұрын
Mobx )))
@lmao498
@lmao498 4 ай бұрын
no thanks, still preferred provider
@keithbertschin1213
@keithbertschin1213 4 ай бұрын
You couldn’t talk any faster could you!
@salmaindrianputri164
@salmaindrianputri164 Жыл бұрын
But im with getx
@ai_mak354
@ai_mak354 Жыл бұрын
GetX!!!))
@TheKiRBiR
@TheKiRBiR 6 күн бұрын
why do concept like these suck all life out of you and kill your desire to be a developer? Is this what awaits in the corporate world?
@AbdulRahim-ok1vs
@AbdulRahim-ok1vs Жыл бұрын
Riverpod
Riverpod Simplified | Easy State Management
14:17
Tadas Petra
Рет қаралды 45 М.
Flutter Clean Architecture Visual Explanation
6:15
Flutter Mapp
Рет қаралды 33 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
State Management Like A Pro - Flutter Riverpod
10:30
Robert Brunhage
Рет қаралды 77 М.
BLoC for Beginners 📱 State Management • Flutter Tutorial
8:44
Flutter BloC Pattern (Create, Read, Update & Delete)
7:44
HeyFlutter․com
Рет қаралды 46 М.
Avoid using StatefullWidget!
3:50
Codrut Erdei
Рет қаралды 9 М.
Managing State in Flutter - Introducing Flutter
5:39
Flutter
Рет қаралды 104 М.
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 248 М.
Flutter Bloc EASY Tutorial
8:25
Flutter Mapp
Рет қаралды 19 М.