How to use a provider inside a custom hook? #913
-
In useOpenAd() {
...
final backToHomeCount = useProvider(
settingsProvider.select((settings) => settings.backToHomeCount));
...
} But with the latest version |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You could pass a WidgetRef obtained from a ConsumerWidget/Consumer as a parameter to your custom hook, or straight up pass the resolved value. |
Beta Was this translation helpful? Give feedback.
You could pass a WidgetRef obtained from a ConsumerWidget/Consumer as a parameter to your custom hook, or straight up pass the resolved value.