load method

Future<YamlDocument?> load()

Implementation

Future<YamlDocument?> load() async {
  if (_cachedYaml != null) return _cachedYaml;
  var currentDir = Directory.current;
  var file = File(path.join(currentDir.path, "config.yaml"));
  if (await file.exists()) {
    var map = loadYamlDocument(await file.readAsString());
    _cachedYaml = map;
    return map;
  }
  return null;
}