Best practice for StateNotifierProvider different states as data #1684
AhmedLSayed9
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've a case where I need state as
initial
when user enter ResendActivateEmailScreen and another state assuccess
to navigate user from ResendActivateEmailScreen to another screen when the call is success (By using ref.listen inside ResendActivateEmailScreen build).I've created the state for my StateNotifier using
Freezed
as following:It's working fine, but as I'm trying to use AsyncValue for my Providers, I'm wondering if it's better to use a mix of AsyncValue and Freezed instead? so my idea is something like this:
or maybe using
enum
here too instead of Freezed as I don't need to store data in the state.What do you think? the unique way of using just Freezed or a mix of AsyncValue and freezed/enum to try to unify with using AsyncValue in other providers?
Beta Was this translation helpful? Give feedback.
All reactions