PluginErrorParams.fromJson constructor
PluginErrorParams.fromJson(})
Implementation
factory PluginErrorParams.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
bool isFatal;
if (json.containsKey('isFatal')) {
isFatal = jsonDecoder.decodeBool('$jsonPath.isFatal', json['isFatal']);
} else {
throw jsonDecoder.mismatch(jsonPath, "'isFatal'", json);
}
String message;
if (json.containsKey('message')) {
message = jsonDecoder.decodeString(
'$jsonPath.message',
json['message'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'message'", json);
}
String stackTrace;
if (json.containsKey('stackTrace')) {
stackTrace = jsonDecoder.decodeString(
'$jsonPath.stackTrace',
json['stackTrace'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'stackTrace'", json);
}
return PluginErrorParams(isFatal, message, stackTrace);
} else {
throw jsonDecoder.mismatch(jsonPath, "'plugin.error params'", json);
}
}