doWork static method

void doWork(
  1. SendPort main
)

Implementation

static void doWork(SendPort main) {
  ReceivePort childThread = ReceivePort();
  SendPort main = childThread.sendPort;
  childThread.listen((message) {
    //9.10 rp2收到消息
    print("rp2 收到消息: $message");
  });
}