AnalysisAnalyzedFilesParams.fromJson constructor

AnalysisAnalyzedFilesParams.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json
)

Implementation

factory AnalysisAnalyzedFilesParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json) {
  json ??= {};
  if (json is Map) {
    List<String> directories;
    if (json.containsKey('directories')) {
      directories = jsonDecoder.decodeList('$jsonPath.directories',
          json['directories'], jsonDecoder.decodeString);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'directories');
    }
    return AnalysisAnalyzedFilesParams(directories);
  } else {
    throw jsonDecoder.mismatch(
        jsonPath, 'analysis.analyzedFiles params', json);
  }
}