close method

Future<bool> close([
  1. String? app
])

Implementation

Future<bool> close([String? app]) async {
  var toClose = app == null ? await getCurrentApp() : app;
  if (toClose != null) {
    HttpClientResponse? response;
    try {
      response = await send("DELETE", "/apps/${toClose}");
      if (response.statusCode != 200) {
        return false;
      }
      return true;
    } finally {
      if (response != null) {
        await response.drain();
      }
    }
  }
  return false;
}