invokeModuleEvent function

void invokeModuleEvent(
  1. int contextId,
  2. String moduleName,
  3. Event? event,
  4. String extra,
)

Implementation

void invokeModuleEvent(
    int contextId, String moduleName, Event? event, String extra) {
  if (KrakenController.getControllerOfJSContextId(contextId) == null) {
    return;
  }
  Pointer<NativeString> nativeModuleName = stringToNativeString(moduleName);
  Pointer<Void> rawEvent = event == null ? nullptr : event.toRaw().cast<Void>();
  _invokeModuleEvent(
      contextId,
      nativeModuleName,
      event == null ? nullptr : event.type.toNativeUtf8(),
      rawEvent,
      stringToNativeString(extra));
  freeNativeString(nativeModuleName);
}