Riverpod or Bloc? Which One is Better?
Vložit
- čas přidán 20. 02. 2023
- 📄You will see side by side comparison between two well-known state management solutions in the Flutter framework i-e Bloc & Riverpod. How they are different from each other and what to choose from them for your next project.
🤖About AI - Please Subscribe :
🔗 / @theaionline
⚡ SUBSCRIBE HERE⚡
🔗 cutt.ly/2XkZz0X
🌐 Social Media
🔗 Linkedin: / taimoorghafar
/ mahdinazmi
🔗 GitHub: github.com/mahdinazmi
github.com/taimoor522
🔗 Twitter: / mahdinazmi
#flutter #fluttertutorial #flutterwidgets #fluttercourse #flutterinhindi #mobileappdevelopment #vscode #reactnative #flutterbloc #flutterstatemanagement #flutterriverpod #riverpodstatemanagement #difference_between_bloc_riverpod #bloc_vs_riverpod - Věda a technologie
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.
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.
Riverpod is excellent and easier to use now with riverpod annotations.
Bloc is so easy if you use freeze package with bloc
@@abrorbobomurodov2361 Riverpod can too.
YES!
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
true
It's like "Fireship taste" when see this video... 😎
Haha I thought the same!
Bloc is better as it extracts all the implementation in separate location. It's works great for teams
It is good for beginner to advance app. But riverpod scales better than BLOc
@@sahilamburefor team work Bloc would be great choice
Coming from BLoC (Cubit) background, I actually learned to use Riverpod from this comparison, better than any Riverpod tutorial I came across. Many thanks!
❤✌
Wow. Sir, what software do you use for such editing?
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!
noted.
I’m experienced with bloc but was a bit confused with riverpod, this helped a lot! Thanks
Glad it helped!
Very straight forward!
Riverpod is better for big apps.
Thank you very well explained
My opinion - Riverpod
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
Yes you are right, Thank you ❤✌
great content you are making, keep it up
Thanks, will do!
Looks like Riverpod is the winner in the comments. Riverpod it is then!
I'm still confused right now, like many job requirements want to use bloc than riverpod
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?
Probably just the size of your app.
I've migrated three projects from Provider to Riverpod. Each time, the code get simpler, more robust, and more featureful, and easier to maintain.
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?
Blo
Bloc
@@flutterguys Thank yoy very much!
Why would I want bloc a river as no competing pods are crossing state crosspods?
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.
✌❤
Bloc has a lot of boilerplate code involved, I wound prefer Riverpod
what is boilerplate ?
Much of code could be unnecessary sometimes
@@baruchfavour9358 thanks BFavour
How about getx?
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!
please make the soundeffects lower and get some better ones
Riverpod
are you real
this video the first of your videos pop to me and now i just watched mostly all of your videos♥♥♥♥
Glad it was helpful!
BLOC 🔹❤️
bloc because more recognize with all class contains prefix "Bloc" :)
Provider FTW.
riverpod has less boiler plate code
From my expierience riverpod is more elastic. Bloc is good in simple apps
No, bloc is the choice for bigger apps believe me i have been there 😉
No , bloc is the great choice for bigger app , also when you work with team
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
In big apps, you cannot use set state to manage the state, and you need to manage the structured state and avoid complexity.
@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
@@algeriennesaffaires7017 Interesting! I really like when people can use simple methods to manage things, especially the old staff, and it still works well.
Yes I have used default setState in bigger projects too but at some point everything starts getting messy so Bloc is recommended
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)
The main problem I see with Riverpod is that anyone, from anywhere, can read a notifier and change the state,
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.
@@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.
@@federicopintaluba3039 "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.
@@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.
Or, it's the legacy StateProvider as you said.
Working for years with Unity and Unreal engines... this is frustrating. You can't over complicate messaging more.
Mobx )))
I prefer Provider 😅
You have to change your voiceover ai to elevenlabs or something slower. It’s very bad and rushed now
You want to go over this any faster pal?
What do you mean?
GetX!!!))
But im with getx
Riverpod
Riverpod