Is it OK to read a provider using GlobalKey? #1500
XuanTung95
started this conversation in
General
Replies: 1 comment 2 replies
-
riverpod-initialize-listener-app-startup may help you. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Idea:
Using
GlobalKey
to obtain a BuildContext.Using
ProviderScope.containerOf(context, listen: false).read(provider)
instead of ref.readUse case: Doing something globally without ref.
Code:
Beta Was this translation helpful? Give feedback.
All reactions