How to get previous value of a provider inside the provider #3910
-
Sort of a weird use case, but is it possible to get the previous value of a state provider while rebuilding that provider? something like final someProvider = StateProvider<int>((ref) {
// get previous value of someProvider
final prev = ref.read(someProvider).previousvalue <-- something like this
} |
Beta Was this translation helpful? Give feedback.
Answered by
rrousselGit
Jan 8, 2025
Replies: 1 comment 1 reply
-
No, you have to use a Notifier |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
RA341
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, you have to use a Notifier