PluginConfiguration.fromJson constructor
PluginConfiguration.fromJson(})
Implementation
factory PluginConfiguration.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is! Map) {
throw jsonDecoder.mismatch(jsonPath, "'PluginConfiguration'", json);
}
bool enabled;
if (json case {'enabled': var encodedEnabled}) {
enabled = jsonDecoder.decodeBool('$jsonPath.enabled', encodedEnabled);
} else {
throw jsonDecoder.mismatch(jsonPath, "'enabled'", json);
}
Map<String, String> diagnosticSeverities;
if (json case {'diagnosticSeverities': var encodedDiagnosticSeverities}) {
diagnosticSeverities = jsonDecoder.decodeMap(
'$jsonPath.diagnosticSeverities',
encodedDiagnosticSeverities,
valueDecoder: jsonDecoder.decodeString,
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'diagnosticSeverities'", json);
}
return PluginConfiguration(enabled, diagnosticSeverities);
}