close method

void close()

关闭Dart通道并清理资源 Close the Dart channel and clean up resources

Implementation

void close() {
  if (_portId != null) {
    IsolateNameServer.removePortNameMapping(_portId.toString());
    _portId = null;
  }
  _receivePort?.close();
  _receivePort = null;
}