static dynamic getEnvVars()

in ui/lib/utils/runtime_env_client.dart [25:50]


  static dynamic getEnvVars({String url = "/"}) async {
    BaseService baseService = new BaseService();

    try {
      var response = await http.get(baseService.getUrl(url));

      if (response.statusCode == 200) {
        var jsonResponse = jsonDecode(response.body);

        if (jsonResponse.containsKey(firebaseConfigVar)) {
          String fixedJsonString =
              jsonResponse[firebaseConfigVar].replaceAllMapped(
            RegExp(r'(\w+): '),
            (match) => '"${match.group(1)}": ',
          );

          jsonResponse[firebaseConfigVar] = jsonDecode(fixedJsonString);
        }

        return jsonResponse;
      }
    } catch (e) {
      log(e.toString());
    }
    return "";
  }