loadFromYaml static method

AnalysisOptions loadFromYaml(
  1. String yamlSource
)

Implementation

static AnalysisOptions loadFromYaml(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(
    excludeGlobs: excludeGlobs.cast<String>().map((e) => Glob(e)).toList(),
    debug: debug,
  );
}