setServicesUserListener static method
Future
setServicesUserListener(
- void onData(
- dynamic event
)?
)
Implementation
static Future setServicesUserListener(void onData(dynamic event)?) async {
if(onData != null) {
if(servicesUserSubscription != null) {
servicesUserSubscription!.cancel();
servicesUserSubscription = null;
}
servicesUserSubscription = _servicesUserEventChannel.receiveBroadcastStream().listen(onData);
}
else {
if(servicesUserSubscription != null) {
servicesUserSubscription!.cancel();
servicesUserSubscription = null;
}
}
}