AddContentOverlay.fromJson constructor
AddContentOverlay.fromJson(})
Implementation
factory AddContentOverlay.fromJson(
JsonDecoder jsonDecoder,
String jsonPath,
Object? json, {
ClientUriConverter? clientUriConverter,
}) {
json ??= {};
if (json is Map) {
if (json['type'] != 'add') {
throw jsonDecoder.mismatch(jsonPath, "equal to 'add'", json);
}
String content;
if (json.containsKey('content')) {
content = jsonDecoder.decodeString(
'$jsonPath.content',
json['content'],
);
} else {
throw jsonDecoder.mismatch(jsonPath, "'content'", json);
}
int? version;
if (json.containsKey('version')) {
version = jsonDecoder.decodeInt('$jsonPath.version', json['version']);
}
return AddContentOverlay(content, version: version);
} else {
throw jsonDecoder.mismatch(jsonPath, "'AddContentOverlay'", json);
}
}