addEventListener method
An implementation of LivespeechtotextPlatform.addEventListener
Implementation
@override
StreamSubscription<dynamic> addEventListener(
String eventName,
Function(dynamic) callback,
) {
switch (eventName) {
case Livespeechtotext.eventSuccess:
return onSuccessEvent
.receiveBroadcastStream()
.map<dynamic>((event) => event)
.listen((event) => callback(event));
default:
return onAnyEvent
.receiveBroadcastStream()
.map<dynamic>((event) => event)
.listen((event) => callback(event));
}
}