cleanup method Null safety

  1. @override
void cleanup()
override

Cleanup and completers or locks used during the communication.

Implementation

@override
void cleanup() {
  if (!_webDriverCommandPipe.isCompleted) {
    _webDriverCommandPipe
        .complete(Future<WebDriverCommand>.value(WebDriverCommand.noop()));
  }

  if (!_driverCommandComplete.isCompleted) {
    _driverCommandComplete.complete(Future<bool>.value(false));
  }
}