AnalysisStatus.fromJson constructor

AnalysisStatus.fromJson(
  1. JsonDecoder jsonDecoder,
  2. String jsonPath,
  3. Object? json, {
  4. ClientUriConverter? clientUriConverter,
})

Implementation

factory AnalysisStatus.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json,
    {ClientUriConverter? clientUriConverter}) {
  json ??= {};
  if (json is Map) {
    bool isAnalyzing;
    if (json.containsKey('isAnalyzing')) {
      isAnalyzing = jsonDecoder.decodeBool(
          '$jsonPath.isAnalyzing', json['isAnalyzing']);
    } else {
      throw jsonDecoder.mismatch(jsonPath, 'isAnalyzing');
    }
    return AnalysisStatus(isAnalyzing);
  } else {
    throw jsonDecoder.mismatch(jsonPath, 'AnalysisStatus', json);
  }
}