dispose method

  1. @override
Future<void> dispose()
override

Implementation

@override
Future<void> dispose() async {
  final receivePort = ReceivePort();
  _commandSendPort.send(DisposeCommand(receivePort.sendPort));
  await receivePort.first;
  receivePort.close();
  _globalReceivePort.close();
  _messageHandlerReceivePort?.close();
  return super.dispose();
}