sendToPort static method

Future<void> sendToPort(
  1. dynamic message

sends a message to the other isolate, which is handled by whatever function was passed to setupIsolateCommunication in that isolate

i.e. background_sendToPort("a") -> main_receiveHandler("a")

values that can be sent are subject to the limitations of SendPort, i.e. primitives and lists/maps thereof


static Future<void> sendToPort(dynamic message) async {
  final SendPort targetPort = IsolateNameServer.lookupPortByName(
      (await isBackgroundIsolate

  if (targetPort != null) {
  } else {
    throw _SendToPortException(await isBackgroundIsolate);