addPluginEventhandler method
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);
}