Flutter Riverpod, A Reactive Caching and Data-binding Framework
Вставка
- Опубліковано 4 лют 2025
- Riverpod is an awesome package that you can use in your Flutter application.
Compile safe
No more ProviderNotFoundException or forgetting to handle loading states. Using Riverpod, if your code compiles, it works.
Provider, without its limitations
Riverpod is inspired by Provider but solves some of it's key issues such as supporting multiple providers of the same type; awaiting asynchronous providers; adding providers from anywhere, ...
Doesn't depend on Flutter
Create/share/tests providers, with no dependency on Flutter. This includes being able to listen to providers without a BuildContext.
Access to slides: slides.com/mha...
خیلی سر راست و عالی بود توضیحات. ممنون.
You can also use Fast Immutable Collections to quickly convert a list or hash or set into an immutable object that has overloaded == and hash to use for family values.
Great point
i like dart way of intro .. awesome
Great explanations
Great content! Nice and precise, covering most of the core providers in flutter riverpod. What's the difference between fluter riverpod and hooks riverpod?
Alert! Full riverpod documentation + lifetime experience is going to explode in just one hour.
Thanks for this awesome talk Majid, would you be able to do a similar one on flutter hooks? I use them but I am interested to know if there's any valuable information you can share about those!
sure
Awesome Majod
Doing god’s work
Riverpod🤩
Default behavior: keep the old state
.autoDispose disposes the old state
ref.keepAlive() keeps the old state
Then what is the logic behind uisng .autoDispose and ref.keepAlive() together?
Imaagine, you have a http request and you want to fire it up when you enter and cancel when you leave a page, however, when the HTTP call is successful, you do not want to do that again when you enter and leave a page. in this case, you can use autoDispose to cancel the HTTP but if you preserve the state, next time you enter it will not fire it up again and you have the state of the call already. does it make sense?
@@mhadaily Correct me if I am Wrong:
1) Without autoDispose, no state is not preserved.
2) With autoDispose, successful state is preserved but unsuccessful state is automatically disposed.
3) Not clear about ref.keepAlive()
@@ani-singh
1) no that is not correct, state are preserved actually, autoDispose will destroy them, check my example that I mentioned
2) again, not exactly! if you have a HTTP call and that is success then the response can be preserved as state and you can retrvied with in autodispose without calling the HTTP again and that is the purposes of number 3 in your comment (next one)
3) keepAlive() in Riverpod 2.0 in .autoDispose() will make your state to be cached and anytime you come retrieve it it comes from a cache. Check out my example that I mentioned again. the HTTP call.
@@mhadaily ref.keepAlive() usecase is still not very clear to me after reading above comments.
1. If a provider without autoDispose() caches the state and do not fire the request again, why do I need autoDispose() and then keepAlive()?
Which one do you prefer overall for all types of applications?
BLoC or Riverpod?
I know bloc in a moderate level. But don't know provider/riverpod. Should I learn riverpod?
It depends, however, I think riverpod will fits any size application with any complexity.
@@mhadaily Thanks
Can't download offline plz make it offline downlodable
I am sorry I don't think it's something that I can do, it's actually UA-cam.