VmService constructor Null safety

VmService(
  1. Stream inStream,
  2. void writeMessage(
    1. String message
    ),
  3. {Log? log,
  4. DisposeHandler? disposeHandler,
  5. Future? streamClosed}
)

Implementation

VmService(
  Stream<dynamic> /*String|List<int>*/ inStream,
  void writeMessage(String message), {
  Log? log,
  DisposeHandler? disposeHandler,
  Future? streamClosed,
}) {
  _streamSub = inStream.listen(_processMessage,
      onDone: () => _onDoneCompleter.complete());
  _writeMessage = writeMessage;
  _log = log == null ? _NullLog() : log;
  _disposeHandler = disposeHandler;
  streamClosed?.then((_) {
    if (!_onDoneCompleter.isCompleted) {
      _onDoneCompleter.complete();
    }
  });
}