addOnStateChangedListener method
StreamSubscription
addOnStateChangedListener(
- dynamic onStateChanged(
- List<
ActiveStateChanged> events
- List<
Event handler for ActiveType when values get updated
If a listener references a BuildContext inside a Widget, override the Widget dispose method and cancel the subscription.
Implementation
StreamSubscription addOnStateChangedListener(
Function(List<ActiveStateChanged> events) onStateChanged) {
final newSubscription = _stateController.stream.listen(onStateChanged);
_subscriptions.add(newSubscription);
return newSubscription;
}