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');
}
String message;
if (json.containsKey('message')) {
message = jsonDecoder.decodeString(
'$jsonPath.message',
json['message'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'message');
}
String stackTrace;
if (json.containsKey('stackTrace')) {
stackTrace = jsonDecoder.decodeString(
'$jsonPath.stackTrace',
json['stackTrace'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'stackTrace');
}
return PluginErrorParams(isFatal, message, stackTrace);
} else {
throw jsonDecoder.mismatch(jsonPath, 'plugin.error params', json);
}
}