loadFromUrlIntoKey method

Future<GlobalConfiguration> loadFromUrlIntoKey(
  1. String url,
  2. String key,
  3. {Map<String, String> queryParameters,
  4. Map<String, String> headers}
)

Loading a configuration file from the given url into the current app config with the given key.

It uses a http GET request to fetch the configuration. The request can be modified with queryParameters and headers.

Implementation

Future<GlobalConfiguration> loadFromUrlIntoKey(String url, String key,
    {Map<String, String> queryParameters,
    Map<String, String> headers}) async {
  Map<String, dynamic> configAsMap = await _getFromUrl(url,
      queryParameters: queryParameters, headers: headers);
  appConfig.putIfAbsent(key, () => configAsMap);
  return _singleton;
}