I am working on building some of the example hooks_riverpod applications and I get an error that the HookConsumerWidget is not a dart class. Is this still a valid widget in the latest version or has it been changed? Thanks.
Asked
Active
Viewed 1,599 times
0
-
`ConsumerWidget` from `flutter_riverpod` and `HookWidget` from flutter_hooks, can share your code snippet ? – Md. Yeasin Sheikh Aug 12 '21 at 20:07
-
this is a snippet right from the riverpod documentation. It is used in the standard flutter counter app. class Count extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { int count = ref.watch(counterProvider).state; return Text('$count'); } } – msmartin43 Aug 12 '21 at 21:59
-
can you provide the link – Md. Yeasin Sheikh Aug 12 '21 at 22:44
-
[https://riverpod.dev/docs/concepts/reading#useprovider-hooks_riverpod-only](https://riverpod.dev/docs/concepts/reading#useprovider-hooks_riverpod-only) – msmartin43 Aug 13 '21 at 14:17
-
i just found an issue there is outdated documentation. – Md. Yeasin Sheikh Aug 13 '21 at 15:15
1 Answers
1
Check your riverpod version. I had the same issue using the version 0.14.0+4 but the problem is solved using ^1.0.0-dev.5.

user3633490
- 31
- 2