rrousselGit / state_notifier

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

StateNotifierProvider.value doesn't handle LocatorMixin #70

Open jaumard opened 1 year ago

jaumard commented 1 year ago

Describe the bug By using this:

StateNotifierProvider<BalanceStore, BalanceState>(create: (_) => BalanceStore()),

I can use read methods of locatorMixin.

But using:

StateNotifierProvider<BalanceStore, BalanceState>.value(balanceStore),

Then read crash with not found dependency.

By reading the source look like one is setting (value as LocatorMixin)..read = _contextToLocator(context) but it is not done on the other case.