Override.fromJson constructor
Override.fromJson(
- JsonDecoder jsonDecoder,
- String jsonPath,
- Object? json
)
Implementation
factory Override.fromJson(
JsonDecoder jsonDecoder, String jsonPath, Object? json) {
json ??= {};
if (json is Map) {
int offset;
if (json.containsKey('offset')) {
offset = jsonDecoder.decodeInt('$jsonPath.offset', json['offset']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'offset');
}
int length;
if (json.containsKey('length')) {
length = jsonDecoder.decodeInt('$jsonPath.length', json['length']);
} else {
throw jsonDecoder.mismatch(jsonPath, 'length');
}
OverriddenMember? superclassMember;
if (json.containsKey('superclassMember')) {
superclassMember = OverriddenMember.fromJson(jsonDecoder,
'$jsonPath.superclassMember', json['superclassMember']);
}
List<OverriddenMember>? interfaceMembers;
if (json.containsKey('interfaceMembers')) {
interfaceMembers = jsonDecoder.decodeList(
'$jsonPath.interfaceMembers',
json['interfaceMembers'],
(String jsonPath, Object? json) =>
OverriddenMember.fromJson(jsonDecoder, jsonPath, json));
}
return Override(offset, length,
superclassMember: superclassMember,
interfaceMembers: interfaceMembers);
} else {
throw jsonDecoder.mismatch(jsonPath, 'Override', json);
}
}