You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Immediately get the state of FlutterBlue
_flutterBlue.state.then((s) {
setState(() {
state = s;
});
});
// Subscribe to state changes
_stateSubscription = _flutterBlue.onStateChanged().listen((s) {
setState(() {
state = s;
});
});
By having onStateChanged() always return current state when listened to, we can avoid the extra then call.
The text was updated successfully, but these errors were encountered:
Having to do a lot of this:
By having onStateChanged() always return current state when listened to, we can avoid the extra then call.
The text was updated successfully, but these errors were encountered: