loadConfig method

Future<void> loadConfig()

Implementation

Future<void> loadConfig() async {
  final file = File(configFilePath);
  if (!file.existsSync()) {
    throw ConfigException("Configuration file `$configFilePath` not found");
  }

  final contents = await file.readAsString();
  final yamlMap = loadYaml(contents);

  if (yamlMap == null || !yamlMap.containsKey('fonts')) {
    throw ConfigException("Invalid configuration file `$configFilePath`");
  }
}