Closed hsul4n closed 4 years ago
You can use the update
method
ConnectivityResult lastConnectivity;
@override
void update(Reader watch) {
final connectivity = watch<ConnectivityResult>();
if (connectivity != lastConnectivity) {
lastConnectivity = connectivity;
// TODO API call
}
}
You can use the
update
methodConnectivityResult lastConnectivity; @override void update(Reader watch) { final connectivity = watch<ConnectivityResult>(); if (connectivity != lastConnectivity) { lastConnectivity = connectivity; // TODO API call } }
This works great with StateNotifier
& StateNotifierProvider
but what about if I'm using something like ChangeNotifierProvider
or ValueNotifier
as my example above.
LocatorMixin works only with StateNotifier
LocatorMixin works only with StateNotifier
So, is there any future planning for implementing with ‘Provider’.
Not for now, no. But PRs are welcomed
Not for now, no. But PRs are welcomed
I like that.. 👍
Does state_notifier support StreamProvider for watching changes so, for example, I'm trying to listen to connectivity changes.
Here's the example: