loadFromPathIntoKey method

Future<GlobalConfiguration> loadFromPathIntoKey(
  1. String path,
  2. String key
)

Loading a json configuration file from a custom path into the current app config with the given key.

Implementation

Future<GlobalConfiguration> loadFromPathIntoKey(
    String path, String key) async {
  String content = await rootBundle.loadString(path);
  Map<String, dynamic> configAsMap = json.decode(content);
  appConfig.putIfAbsent(key, () => configAsMap);
  return _singleton;
}