Flutter StateNotifier + Riverpod Tutorial – Immutable State Management

Flutter StateNotifier + Riverpod Tutorial – Immutable State Management

Reso Coder

3 года назад

30,931 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Mustafa Ahmed Raza
Mustafa Ahmed Raza - 29.12.2022 09:55

anyone can explain why he is not using futureprovider for weather network call instead of all boiler stuff done with statenotifer ?

Ответить
Hesham Abuzaid
Hesham Abuzaid - 23.08.2022 11:27

thanks a lot the master of flutter.

Ответить
Rafael Alves
Rafael Alves - 23.03.2022 19:34

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.

Ответить
Delman Ali
Delman Ali - 08.01.2022 15:28

Please do more app on riverpod

Ответить
Osmancan Akagündüz
Osmancan Akagündüz - 29.12.2021 13:42

This package old so we can't reach state property like you . So can you upload new video about riverpod please :D

Ответить
Siddharth Bisht
Siddharth Bisht - 28.12.2021 16:48

Why are you providing FakeWeatherRepository to weatherNotifierProvider when WeatherNotifier can just import it inside its code?

Ответить
Farhan Farooqui
Farhan Farooqui - 26.10.2021 09:57

Can you give an update on the StateNotifierStateProvider? I can't find it on the latest version. I

Ответить
techZoNe
techZoNe - 12.08.2021 18:08

Please continue this series

Ответить
Alban R
Alban R - 26.07.2021 11:51

Thank you so much ! This tutorial is awesome !!

Ответить
Meshkat Shadik
Meshkat Shadik - 26.06.2021 23:43

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!

Ответить
Thiago Carvalho
Thiago Carvalho - 16.06.2021 15:31

Why don't you use equatable package?

Ответить
Iqbol Adahamjonov
Iqbol Adahamjonov - 25.05.2021 07:03

Can you please make a video about GetX state management, what are your thoughts about it?

Ответить
Francesco Freddi
Francesco Freddi - 14.05.2021 21:09

**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"))

Ответить
Santosh Kawale
Santosh Kawale - 12.05.2021 13:10

Thanks for great tutorial....new version released with breaking changes....are there any chances of updated tuturial??

Ответить
SRJ Official
SRJ Official - 06.05.2021 13:46

Really appreciate your work..Superb work.. Got what i needed.

Ответить
Amin Abu Dahab
Amin Abu Dahab - 04.05.2021 12:13

Hi, I was wondering .. do you do projects?

Ответить
Daniel Archer
Daniel Archer - 29.04.2021 15:08

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 😅

Ответить
Наиль Гилазиев
Наиль Гилазиев - 30.03.2021 22:48

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 :(

Ответить
TecnoRero
TecnoRero - 25.03.2021 03:45

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!

Ответить
Nicolas Fourcade
Nicolas Fourcade - 20.03.2021 05:09

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.

Ответить
Hector A
Hector A - 11.03.2021 23:58

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.

Ответить
Ben
Ben - 08.03.2021 22:24

How to check net connectivity in riverpod?

Ответить
Terblanche Daniel
Terblanche Daniel - 18.02.2021 15:46

Why do you not have a BILLION subscribers yet? Quality content man. Thanks a lot.

Ответить
sharukh rahman
sharukh rahman - 12.02.2021 19:12

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

Ответить
Akash Solanki
Akash Solanki - 10.02.2021 08:27

Mat, do u think Riverpod should replace BLoc in DDD?

Ответить
Yair Chen
Yair Chen - 07.02.2021 22:59

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

Ответить
B ram
B ram - 05.02.2021 15:25

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.

Ответить
Dennis Barzanoff
Dennis Barzanoff - 20.01.2021 02:06

These proxy providers started being really annoying in my projects, should I swap for Riverpod?

Ответить
George Vincent
George Vincent - 17.01.2021 20:08

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.

Ответить
Abdullahi Addow
Abdullahi Addow - 07.01.2021 16:18

this is bloc like syntax

Ответить
Vinayak K
Vinayak K - 03.01.2021 18:39

Thanks a lot for this video. Now I can avoid all the messy BlocProviders. Also, I wanted to know how we can listen to multiple providers in riverpod ProviderListener. Is there something similar to Bloc's MultiBlocListener?

Ответить
Dhruv Raval
Dhruv Raval - 30.12.2020 19:19

Which video editor you used for creating video and for screen recorder?

Ответить
Abbas Alhashim
Abbas Alhashim - 30.12.2020 04:06

Great tutorials! Can you make a complete login system using phone auth?

Ответить
Franca
Franca - 24.12.2020 05:52

Hope you share some thoughts about GetX

Ответить
Arnau Alloza
Arnau Alloza - 23.12.2020 14:43

What is better? Flutter bloc or riverpod?

Ответить
faisal mushtaq
faisal mushtaq - 22.12.2020 08:40

thanks alot for this

Ответить
Ali Akkawi
Ali Akkawi - 20.12.2020 08:35

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

Ответить
Loh
Loh - 17.12.2020 20:54

Amazing! Would really love to see how to add 'Dartz Either' into this implementation.

Ответить
Domasch92
Domasch92 - 17.12.2020 10:04

Is there any chance you will make an discord channel for your community? That would be awesome

Ответить
Thomas Mabika
Thomas Mabika - 16.12.2020 13:39

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?

Ответить
Nilesh Bhakre
Nilesh Bhakre - 15.12.2020 13:38

as a bloc lover, i want riverpod to become more robust state management package,

Ответить
Diogo Ribeiro
Diogo Ribeiro - 13.12.2020 16:10

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<Object> 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<Object> get props => [weather];
}

Ответить
Sanjib Dutta
Sanjib Dutta - 12.12.2020 20:37

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..🙏

Ответить
Mohammad Ashour
Mohammad Ashour - 12.12.2020 17:52

Thanks a million for the super clean explanation! awesome as always

Ответить