Is a Context Provider good practice? #1386
MateusAmin
started this conversation in
General
Replies: 1 comment 1 reply
-
No this is a bad idea. Don't pass a BuildContext to your providers |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This makes it easy to access the context in a Riverpod app. I can create a snackbar message (I see people just using snackbar providers instead), interface with the router, and have a async proof way of accessing the current context.
For example:
Just include the builder in your widget tests.
Beta Was this translation helpful? Give feedback.
All reactions