handler property

  1. @override
set handler (CallEventHandler handler)
override

Set the handler to handle CallKeep events.

Implementation

@override
set handler(CallEventHandler handler) {
  // Cancel the previous subscription if it exists
  _eventChannelSubscription?.cancel();

  _eventChannelSubscription =
      eventChannel.receiveBroadcastStream().listen((data) {
    final event = CallKeepEventMapper.eventFromData(data);
    handler.handle(event.event, event.type);
  });
}