loadFromYaml static method

AnalysisOptions loadFromYaml(
  1. Folder root,
  2. String yamlSource
)

Implementation

static AnalysisOptions loadFromYaml(Folder root, String yamlSource) {
  final yaml =
      json.decode(json.encode(loadYaml(yamlSource))) as Map<String, dynamic>;
  final options = yaml['string_literal_finder'] as Map<String, dynamic>?;
  final excludeGlobs =
      options?['exclude_globs'] as List<dynamic>? ?? <dynamic>[];
  final debug = options?['debug'] as bool? ?? false;
  return AnalysisOptions(
    root: root,
    excludeGlobs: excludeGlobs.cast<String>().map((e) => Glob(e)).toList(),
    debug: debug,
  );
}