notification method

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

Function to attach passed onEventNotification to websocket channel listener.

Implementation

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