close static method

Future close({
  1. bool force = false,
  2. void onAlreadyStarted()?,
})

Implementation

static Future close({
  bool force = false,
  void Function()? onAlreadyStarted,
}) async {
  if (isRunning) {
    await instance._rawServer.close(force: force);
    _server = null;
  } else {
    if (onAlreadyStarted != null) {
      onAlreadyStarted();
    } else {
      log('Server already started');
    }
  }
}