loadFromUrl method

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

Loading a configuration file from the given url into the current app config using a http GET request to fetch the configuration.

The request can be modified with queryParameters and headers.

Implementation

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