close method Null safety

Future<void> close()

Closes the server.

Implementation

Future<void> close() async {
  if (this._server == null) {
    return;
  }
  await this._server!.close(force: true);
  print('Server running on http://localhost:$_port closed');
  this._started = false;
  this._server = null;
}