notification method

dynamic notification(
  1. dynamic event, [
  2. int? handle
])

Function to attach passed onEventNotification to websocket channel listener.

Implementation

dynamic notification(dynamic event, [int? handle]) {
  final void Function(dynamic, int)? func = onEventNotification;
  if (func != null) {
    final int hand = handle ?? event.handle as int;
    if (event.runtimeType != CaptureException) {
      func(event, hand);
    } else {
      func(event, hand);
    }
  } else {
    throw CaptureException(SktErrors.ESKT_EVENTNOTCREATED,
        'please provide function for this.onEventNotification.');
  }
}