invoke method

  1. @override
String invoke(
  1. String method,
  2. dynamic params,
  3. InvokeModuleCallback callback
)

Implementation

@override
String invoke(String method, dynamic params, callback) {
  if (method == 'init') {
    return init(params, (String id, Event event) {
      moduleManager!.emitModuleEvent(name, event: event, data: id);
    });
  } else if (method == 'addEvent') {
    addEvent(params[0], params[1]);
  } else if (method == 'send') {
    send(params[0], params[1]);
  } else if (method == 'close') {
    close(params[0], params[1], params[2]);
  }
  return '';
}