PluginVersionCheckParams.fromJson constructor
PluginVersionCheckParams.fromJson(})
Implementation
factory PluginVersionCheckParams.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
String byteStorePath;
if (json.containsKey('byteStorePath')) {
byteStorePath =
clientUriConverter?.fromClientFilePath(
jsonDecoder.decodeString(
'$jsonPath.byteStorePath',
json['byteStorePath'],
),
) ??
jsonDecoder.decodeString(
'$jsonPath.byteStorePath',
json['byteStorePath'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'byteStorePath');
}
String sdkPath;
if (json.containsKey('sdkPath')) {
sdkPath =
clientUriConverter?.fromClientFilePath(
jsonDecoder.decodeString('$jsonPath.sdkPath', json['sdkPath']),
) ??
jsonDecoder.decodeString('$jsonPath.sdkPath', json['sdkPath']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'sdkPath');
}
String version;
if (json.containsKey('version')) {
version = jsonDecoder.decodeString(
'$jsonPath.version',
json['version'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'version');
}
return PluginVersionCheckParams(byteStorePath, sdkPath, version);
} else {
throw jsonDecoder.mismatch(jsonPath, 'plugin.versionCheck params', json);
}
}