PluginStatusParams.fromJson constructor

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

Implementation

factory PluginStatusParams.fromJson(
    JsonDecoder jsonDecoder, String jsonPath, Object? json,
    {ClientUriConverter? clientUriConverter}) {
  json ??= {};
  if (json is Map) {
    AnalysisStatus? analysis;
    if (json.containsKey('analysis')) {
      analysis = AnalysisStatus.fromJson(
          jsonDecoder, '$jsonPath.analysis', json['analysis'],
          clientUriConverter: clientUriConverter);
    }
    return PluginStatusParams(analysis: analysis);
  } else {
    throw jsonDecoder.mismatch(jsonPath, 'plugin.status params', json);
  }
}