send method

  1. @override
void send(
  1. int type, [
  2. dynamic payload,
  3. int? contentType
])
override

Implementation

@override
void send(int type, [dynamic payload, int? contentType]) {
  try {
    log.info(
        "Sending message ${MessageCode.get(type)} with payload $payload to the outer control");
    final _payload = encoding.encode(Payload(contentType, payload));

    postMessage([
      type,
      _payload.header,
      _payload.data,
    ]);
  } catch (e, stack) {
    print(e);
    print(stack);
  }
}