your tutorial confused me when i started Flutter a year ago, but now they are the most helpful. Your videos are the best for people that already have a little experience and above
I know Im asking randomly but does anyone know of a tool to log back into an Instagram account?? I was stupid lost my account password. I appreciate any assistance you can give me
Your channel is SO helpful, I'm learning tons of good practices and ways to improve my horrible Statefulwidgets-state-management app. I already read DDD book so now I plan to apply these concepts and your DDD course to my app!
Really awesome video about statenotifier plus riverpod. I would be super interested which shortcut you used at 19:36 . This one looks really super useful
I have small question, how do we use useProvider inside life cycle hooks such as didChangeAppLifecycleState? since it's outside the widget build context?
If I have 2 textformfields and a button to submit, like a LoginPage, where I save the 2 textformdfield values to submit? in variables on the StatelessWidget or in the StateNotifier? I have a more complex case, where I have 3 dropdowns (Country, State, and City) and if I change country the state and city dropdowns are reset, and I dont know the correct way to do this with this approach.
Hi thank you a lot for this tutorial. I used this tutorial to get Data from the FireStore. But I was wondering, why the Provider doesn't cache the results, like it did in the 40 minutes Riverpod tutorial. Do you have any recommendations on how I would be able to achieve, that? Cause in my UseCase the user can change the state of the widget with a buttonclick and I would like to prevent getting the data from the Store for each click.
Hello, in Cubit there is buildWhen to determine when to rebuild based on the change of a state property. In Riverpod we have that possibility? I know that you can create a Provider that reacts to the change of a property of a StateNotifierProvider, and work with the new Provider. But it seems too twisted to be real. From already thank you very much for your time.
Great tutorial as always. Till date I use bloc and comfortable with that. But riverpod looks better. I just started a new project in flutter, it will be long run project. Can you please tell me, whether should I use riverpod or bloc is also fine. Your suggestion means a lot to me..🙏
The original Bloc with events is great if you need event sourcing. However, if you'd use Cubit anyway, you might as well use StateNotifier instead. By the way, you can also use Bloc with Riverpod. Here's a package that allows you to do that without any more work on your part: pub.dev/packages/riverbloc
Hey brother, when I was implementing statenotifier today. userStateNotifierProvider (i.e. statenotifier variable) is with 2 arguments instead of 1. Then another problem is I can't watch by (userStateNotifierProvider.state) there is no scene of state. I had to install the old version of riverpod to work!
How would you modify the code if I want to get the weather of "some" location on the load itself? Since it is not recommended to use context.read() in build methods, I am really not sure how one would do that.
It might be a stupid question but it looks like ChangeNotifier has less code and simpler to read. Is StateNotifier better? if so how? thank you very much
@@dimitristotsios2292 yes I saw that too, I just wanted to see if Matt wants to change strategies when he saw this Riverpod. And if he does I wanted to see why. Because if he changes there is a good reason for it. He is a good and precise programmer.
Amir Ebrahimi Riverpod is a hot topic this time, there are several solutions one can choose for state management. It has poor documentation and confusing for the newcomers, but tuts like this one reveals its power and elegance. I have also took a view of Binder which is somehow similar to Riverpod both are implemented by very active programmers and look very promising.
New projects I create right now use Riverpod + StateNotifier because I usually use Bloc only with the Cubit classes anyway (I don't need event sourcing). It's more about Provider vs Riverpod than about Bloc vs Riverpod though. You can use Bloc/Cubit with Riverpod too - either create and maintain your own BlocProvider class or use a package such as this one: pub.dev/packages/riverbloc
Hey man, this is just what I needed! Thanks a lot. Could you maybe explain riverpod with hooks? Or just like the most common hooks, there aren't many examples on the internet and it leaves me confused quite often. For instance, I thought we could useContext() inside an onTap function when we get it out of the build method, but it doesn't work there. So when would useContext be useful? Also I'm kinda struggling with the idea of useEffect. Anyways, thanks for this. Hope to see more riverpod stuff! :D
Great explanation and examples, thanks a lot. i Know it is a silly question but which approach is better in your opinion, Riverpod with State notifier or Cubit. thanks
I won't say what's better but rather what I use in my new projects - Riverpod with StateNotifier. But then again, you can use Bloc/Cubit and Riverpod too! pub.dev/packages/riverbloc
@@ResoCoder thanks for your respond, i guess I asked the question the wrong way. I meant to ask about using Riverpod with State notifier VS using Bloc and Cubit without Riverpod
@@ResoCoder why do you choose riverpod for your next project instead of riverbloc or flutter_bloc? It seems their usage are very similar. Maybe you could dissect them by performance, memory usage, best practices, etc?
it's interesting how riverpod is very similar to cubit. With cubit we could use the package bloc_test which makes testing really easy. What about riverpod? how would you go about testing your code here?
@@matthieuregnauld9648 It's fine, but it gets really messy when you have tons of providers and I don't think it makes sense to seep them in the context anyway. They are pretty mainstream though
for anyone getting errors with the state notifier provider in the search page, make the changes below: watch(weatherNotifierProvider.state) → watch(weatherNotifierProvider) and watch(weatherNotifierProvider) → watch(weatherNotifierProvider.notifier) if anyone knows why this works, please tell me. I assume its just a syntax change but I have no idea 😅
The riverpod ^0.13.0 to ^0.14.0 update was more complex than my post (below) indicated. See riverpod.dev/docs/migration/0.13.0_to_0.14.0/ If you use the 0.12.1 version (like Matt), his code should work … although I had some weird errors in going back.
For those using Equatable, can you confirm which aproach is the best one? EXAMPLE 1: Using EquatableMixin in each implementation... class WeatherLoaded extends WeatherState with EquatableMixin { final Weather weather; const WeatherLoaded(this.weather); @override List get props => [weather]; } EXAMPLE 2: ... Or extends Equatable in the abstract class in order to our implementations follow the contract? abstract class WeatherState extends Equatable { const WeatherState(); } class WeatherLoaded extends WeatherState { final Weather weather; const WeatherLoaded(this.weather); @override List get props => [weather]; }
I Just learned Cubit and im quit confused. It is pretty similar so i will ask here. Can i have multiple cubids/notifiers in my app? If i created cupid for auth, can I create next cubid for fetching data from database or i should look for something else.
You actually *should* have multiple StateNotifiers/Cubits. And you're right, Cubit and StateNotifier are very similar and my unscientific guess would be that they're the same in 99% of circumstances. The only difference is that StateNotifier is not a Stream.
@@ResoCoder Thanks for your reply. Now I know how to work properly with cubit/riverpod (hope so hah). Let me ask for something cuz I'm just curious. Are you english native speaker or you just learned a lot and worked in english?
From pub.dev flutter_riverpod ChangeLog 0.14.0: BREAKINGflutter_ CHANGE The syntax for using StateNotifierProvider was updated. Appears to me that .state is no longer needed, or allowed.
**state chenge name, in last flutter_riverpod update; i think So... what i need to watch about weatherNotifierProvider... mmmmmmmmmmm There is an exception on gitHub final project, now with flutter_riverpod: ^0.14.0+3: +Exception has occurred.NoSuchMethodError (NoSuchMethodError: Class 'WeatherInitial' has no instance method 'getWeather'. Receiver: Instance of 'WeatherInitial' Tried calling: getWeather("london"))
your tutorial confused me when i started Flutter a year ago, but now they are the most helpful. Your videos are the best for people that already have a little experience and above
I know Im asking randomly but does anyone know of a tool to log back into an Instagram account??
I was stupid lost my account password. I appreciate any assistance you can give me
Same happened with me
Thanks a lot Reso, thanks to you and your Flutter DDD course I got a job.
Great to hear that! My pleasure!
Congratulate to you. I got a job too )
This tutorial being outdated helped me a lot to improve my skills. I learned so much fixing the old code issues to the new version.
Thank you so much for this video. You are my best flutter teacher in youtube.
Why do you not have a BILLION subscribers yet? Quality content man. Thanks a lot.
Man like Reso! Thank you! We needed this tut!
Thanks so much, I've suffering with this for a long time
Please continue this series
Thank you and hope the next video would talk about the States_rebuilder, it's now immutable and super clean syntax.
Your channel is SO helpful, I'm learning tons of good practices and ways to improve my horrible Statefulwidgets-state-management app. I already read DDD book so now I plan to apply these concepts and your DDD course to my app!
Really appreciate your work..Superb work.. Got what i needed.
Amazing! Would really love to see how to add 'Dartz Either' into this implementation.
me too
Thank you so much ! This tutorial is awesome !!
Thank you for covering this.
Thanks a million for the super clean explanation! awesome as always
Hope you share some thoughts about GetX
made my night :)
i can focus better at night.
Really awesome video about statenotifier plus riverpod. I would be super interested which shortcut you used at 19:36 . This one looks really super useful
thanks a lot the master of flutter.
Thanks for great tutorial....new version released with breaking changes....are there any chances of updated tuturial??
Mat, do u think Riverpod should replace BLoc in DDD?
I have small question, how do we use useProvider inside life cycle hooks such as didChangeAppLifecycleState? since it's outside the widget build context?
Can you give an update on the StateNotifierStateProvider? I can't find it on the latest version. I
Hey when to use bloc and when to use riverpod.. any pointers would be helpful!.. BTW, only your channel has the best content for flutter keep it up
Hi, I was wondering .. do you do projects?
Can you please make a video about GetX state management, what are your thoughts about it?
This is what I'm looking for 😁
How to check net connectivity in riverpod?
If I have 2 textformfields and a button to submit, like a LoginPage, where I save the 2 textformdfield values to submit? in variables on the StatelessWidget or in the StateNotifier?
I have a more complex case, where I have 3 dropdowns (Country, State, and City) and if I change country the state and city dropdowns are reset, and I dont know the correct way to do this with this approach.
anyone can explain why he is not using futureprovider for weather network call instead of all boiler stuff done with statenotifer ?
Please help to figure out how to use Navigator 2.0 (web) + riverpod + state_notifier. There is no any good practice example on the internet :(
Hi thank you a lot for this tutorial.
I used this tutorial to get Data from the FireStore. But I was wondering, why the Provider doesn't cache the results, like it did in the 40 minutes Riverpod tutorial. Do you have any recommendations on how I would be able to achieve, that?
Cause in my UseCase the user can change the state of the widget with a buttonclick and I would like to prevent getting the data from the Store for each click.
Great tutorials! Can you make a complete login system using phone auth?
I've looked many articles. but they seem to be not following the best practices which is using BLoC pattern
Please do more app on riverpod
Hello, in Cubit there is buildWhen to determine when to rebuild based on the change of a state property. In Riverpod we have that possibility?
I know that you can create a Provider that reacts to the change of a property of a StateNotifierProvider, and work with the new Provider. But it seems too twisted to be real.
From already thank you very much for your time.
thanks alot for this
Which video editor you used for creating video and for screen recorder?
Great tutorial as always. Till date I use bloc and comfortable with that. But riverpod looks better. I just started a new project in flutter, it will be long run project. Can you please tell me, whether should I use riverpod or bloc is also fine. Your suggestion means a lot to me..🙏
The original Bloc with events is great if you need event sourcing. However, if you'd use Cubit anyway, you might as well use StateNotifier instead. By the way, you can also use Bloc with Riverpod. Here's a package that allows you to do that without any more work on your part: pub.dev/packages/riverbloc
@@ResoCoder great. thanks a lot 🙏
Please, a tutorial about migration Bloc v6 > v6.1.0
Why are you providing FakeWeatherRepository to weatherNotifierProvider when WeatherNotifier can just import it inside its code?
Hey brother, when I was implementing statenotifier today.
userStateNotifierProvider (i.e. statenotifier variable) is with 2 arguments instead of 1.
Then another problem is I can't watch by (userStateNotifierProvider.state) there is no scene of state.
I had to install the old version of riverpod to work!
Is there any chance you will make an discord channel for your community? That would be awesome
How would you modify the code if I want to get the weather of "some" location on the load itself? Since it is not recommended to use context.read() in build methods, I am really not sure how one would do that.
It might be a stupid question but it looks like ChangeNotifier has less code and simpler to read. Is StateNotifier better? if so how? thank you very much
If you want to create a large project do you prefer Bloc or Riverpod?
Whatever you re comfortable with. In this example we see similar technique to state emition of bloc compined with Riverpod providers.
@@dimitristotsios2292 yes I saw that too, I just wanted to see if Matt wants to change strategies when he saw this Riverpod. And if he does I wanted to see why. Because if he changes there is a good reason for it. He is a good and precise programmer.
Amir Ebrahimi Riverpod is a hot topic this time, there are several solutions one can choose for state management. It has poor documentation and confusing for the newcomers, but tuts like this one reveals its power and elegance. I have also took a view of Binder which is somehow similar to Riverpod both are implemented by very active programmers and look very promising.
@@dimitristotsios2292 Agreed. I personally use Bloc and I'm comfortable with it I think it is a good approach.
New projects I create right now use Riverpod + StateNotifier because I usually use Bloc only with the Cubit classes anyway (I don't need event sourcing). It's more about Provider vs Riverpod than about Bloc vs Riverpod though. You can use Bloc/Cubit with Riverpod too - either create and maintain your own BlocProvider class or use a package such as this one: pub.dev/packages/riverbloc
Hey man, this is just what I needed! Thanks a lot. Could you maybe explain riverpod with hooks? Or just like the most common hooks, there aren't many examples on the internet and it leaves me confused quite often. For instance, I thought we could useContext() inside an onTap function when we get it out of the build method, but it doesn't work there. So when would useContext be useful? Also I'm kinda struggling with the idea of useEffect. Anyways, thanks for this. Hope to see more riverpod stuff! :D
Great explanation and examples, thanks a lot. i Know it is a silly question but which approach is better in your opinion, Riverpod with State notifier or Cubit. thanks
I won't say what's better but rather what I use in my new projects - Riverpod with StateNotifier. But then again, you can use Bloc/Cubit and Riverpod too! pub.dev/packages/riverbloc
@@ResoCoder thanks for your respond, i guess I asked the question the wrong way. I meant to ask about using Riverpod with State notifier VS using Bloc and Cubit without Riverpod
@@ResoCoder why do you choose riverpod for your next project instead of riverbloc or flutter_bloc? It seems their usage are very similar. Maybe you could dissect them by performance, memory usage, best practices, etc?
it's interesting how riverpod is very similar to cubit. With cubit we could use the package bloc_test which makes testing really easy. What about riverpod? how would you go about testing your code here?
23:35 Syntax for snackbar call has changed:
flutter.dev/docs/release/breaking-changes/scaffold-messenger
I smell a `freezed` implementation on top of this coming up next
I still feel more comfortable using cubit + injectible
Everyone has their preferences and these two packages are great and stable pieces of code too!
Why don't you use equatable package?
What is better? Flutter bloc or riverpod?
These proxy providers started being really annoying in my projects, should I swap for Riverpod?
Why is it getting annoying? I'm curious, since I plan to use them in my project.
@@matthieuregnauld9648 It's fine, but it gets really messy when you have tons of providers and I don't think it makes sense to seep them in the context anyway.
They are pretty mainstream though
This package old so we can't reach state property like you . So can you upload new video about riverpod please :D
i try use freezed but failed . plz give me a hint how to use freezed for this Tutoria
Did you watch his video dedicated to freezed? What's not working?
for anyone getting errors with the state notifier provider in the search page, make the changes below:
watch(weatherNotifierProvider.state) → watch(weatherNotifierProvider)
and
watch(weatherNotifierProvider) → watch(weatherNotifierProvider.notifier)
if anyone knows why this works, please tell me. I assume its just a syntax change but I have no idea 😅
The riverpod ^0.13.0 to ^0.14.0 update was more complex than my post (below) indicated. See riverpod.dev/docs/migration/0.13.0_to_0.14.0/
If you use the 0.12.1 version (like Matt), his code should work … although I had some weird errors in going back.
For those using Equatable, can you confirm which aproach is the best one?
EXAMPLE 1:
Using EquatableMixin in each implementation...
class WeatherLoaded extends WeatherState with EquatableMixin {
final Weather weather;
const WeatherLoaded(this.weather);
@override
List get props => [weather];
}
EXAMPLE 2:
... Or extends Equatable in the abstract class in order to our implementations follow the contract?
abstract class WeatherState extends Equatable {
const WeatherState();
}
class WeatherLoaded extends WeatherState {
final Weather weather;
const WeatherLoaded(this.weather);
@override
List get props => [weather];
}
I'd go with the second approach if you want to use Equatable.
@@ResoCoder thank you! :)
as a bloc lover, i want riverpod to become more robust state management package,
this is bloc like syntax
I Just learned Cubit and im quit confused. It is pretty similar so i will ask here. Can i have multiple cubids/notifiers in my app? If i created cupid for auth, can I create next cubid for fetching data from database or i should look for something else.
of course you can. You can have AuthCubit, WeatherCubit, UserCubit etc.
You actually *should* have multiple StateNotifiers/Cubits. And you're right, Cubit and StateNotifier are very similar and my unscientific guess would be that they're the same in 99% of circumstances. The only difference is that StateNotifier is not a Stream.
@@ResoCoder Thanks for your reply. Now I know how to work properly with cubit/riverpod (hope so hah). Let me ask for something cuz I'm just curious. Are you english native speaker or you just learned a lot and worked in english?
From pub.dev flutter_riverpod ChangeLog 0.14.0:
BREAKINGflutter_ CHANGE The syntax for using StateNotifierProvider was updated.
Appears to me that .state is no longer needed, or allowed.
**state chenge name, in last flutter_riverpod update; i think
So... what i need to watch about weatherNotifierProvider... mmmmmmmmmmm
There is an exception on gitHub final project, now with flutter_riverpod: ^0.14.0+3:
+Exception has occurred.NoSuchMethodError (NoSuchMethodError: Class 'WeatherInitial' has no instance method 'getWeather'.
Receiver: Instance of 'WeatherInitial'
Tried calling: getWeather("london"))
Hope you share some thoughts about GetX