addPluginEventhandler method

void addPluginEventhandler(
  1. MessageType type,
  2. Function handler
)

Dynamically define the handler for each plugin event

Implementation

void addPluginEventhandler(MessageType type, Function handler) {
  if (pluginListener == null) {
    pluginListener = PluginEventListener('PluginListener-$pluginId');
    log('PluginListener: ${pluginListener.hashCode}');
  }
  handledEvents.add(type);
  pluginListener!.addPluginEventHandler(type, handler);
}