getCurrentApp method

Future<String?> getCurrentApp()

Implementation

Future<String?> getCurrentApp() async {
  HttpClientResponse? response;
  try {
    response = await send("GET", "/apps");
    if (response.statusCode == 302) {
      var loc = response.headers.value("location")!;
      var uri = Uri.parse(loc);
      return uri.pathSegments[1];
    }
    return null;
  } finally {
    if (response != null) {
      await response.drain();
    }
  }
}