loadSolution method

  1. @nonVirtual
Future<void> loadSolution()

Implementation

@nonVirtual
Future<void> loadSolution() async {
  final maps = <Map>[];
  for (var solution in _solutions) {
    if (solution.filePath != null && solution.filePath!.isNotEmpty) {
      var map = await fetchSolutionMap(solution.filePath!);
      if (map != null) {
        maps.add(map);
      }
    }
  }
  Schema.loadSolutionsFromMaps(maps, environment);
  // Make sure that any language resources are loaded as the default 'en' language code may not exist
  Solution.setLanguage(Solution.languages[0]);
  // Now try to load the correct language resources based on the system locale
  final locale = WidgetsBinding.instance.platformDispatcher.locale;
  Solution.setLanguage("${locale.languageCode}_${locale.countryCode}");
}