loadSolutionsFromAssets static method

Future loadSolutionsFromAssets(
  1. List<String> paths,
  2. String environment, {
  3. String language = "en",
})

Implementation

static Future loadSolutionsFromAssets(List<String> paths, String environment,
    {String language = "en"}) async {
  final maps = <Map>[];
  for (var path in paths) {
    try {
      _log.info("Getting asset '$path'");
      var data = await rootBundle.loadString(path);
      var solution = json.decodeWithReviver(data);
      maps.add(solution);
    } catch (e) {
      _log.severe("Error loading file '$path' from assets.", e);
    }
  }

  _log.info("Building Solution from ${maps.length} maps");
  loadSolutionsFromMaps(maps, environment, language: language);
}