PrioritizedSourceChange.fromJson constructor
PrioritizedSourceChange.fromJson(})
Implementation
factory PrioritizedSourceChange.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
int priority;
if (json.containsKey('priority')) {
priority = jsonDecoder.decodeInt(
'$jsonPath.priority',
json['priority'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'priority');
}
SourceChange change;
if (json.containsKey('change')) {
change = SourceChange.fromJson(
jsonDecoder,
'$jsonPath.change',
json['change'],
clientUriConverter: clientUriConverter,
);
} else {
throw jsonDecoder.mismatch(jsonPath, 'change');
}
return PrioritizedSourceChange(priority, change);
} else {
throw jsonDecoder.mismatch(jsonPath, 'PrioritizedSourceChange', json);
}
}