safeEmitAsFuture method
Implementation
Future<dynamic> safeEmitAsFuture(
String event, [
Map<String, dynamic>? args,
]) async {
try {
final Completer<dynamic> completer = Completer<dynamic>();
Map<String, dynamic> arguments = {
'callback': completer.complete,
'errback': completer.completeError,
...?args,
};
_emitter.emitAsFuture(event, arguments);
return completer.future;
} catch (error) {
logger.e(
'safeEmitAsFuture() event listener threw an error [event:$event]:$error',
);
}
}