loadEnvFromServer function

Future<Map<String, String>> loadEnvFromServer()

///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////

Implementation

// II. ENVIRONMENT CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////
Future<Map<String, String>> loadEnvFromServer() async {
  final response = await http.get(Uri.parse('http://104.190.135.7/rali/env.json'));
  if (response.statusCode == 200) {
    return Map<String, String>.from(json.decode(response.body));
  }
  throw Exception('Failed to load .env file from server');
}