rrousselGit / state_notifier

ValueNotifier, but outside Flutter and with some extra perks
MIT License
311 stars 28 forks source link

How to use StateNotifierProvider with Provider without Riverpod? #79

Closed tomekit closed 10 months ago

tomekit commented 10 months ago

In the documentation: https://pub.dev/packages/state_notifier#integration-with-providerservice-locators there is an example how to use this package with e.g. https://pub.dev/packages/provider package.

I am having problems finding where should I import: StateNotifierProvider from. It doesn't exist in package:provider/provider.dart, it does however resolve to: package:hooks_riverpod/hooks_riverpod.dart, but even then IDE complains:

The element type 'StateNotifierProvider<MyClass, MyState>' can't be assigned to the list type 'SingleChildWidget'.
tomekit commented 10 months ago

It does seem I have missed the: https://pub.dev/packages/flutter_state_notifier package somehow.