toJson method
Implementation
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (id != null) {
json[r'id'] = id;
}
json[r'name'] = name;
if (percentage != null) {
json[r'percentage'] = percentage;
}
if (percentageAttributes.isNotEmpty) {
json[r'percentageAttributes'] =
percentageAttributes.map((v) => LocalApiClient.serialize(v)).toList();
}
if (colouring != null) {
json[r'colouring'] = colouring;
}
if (avatar != null) {
json[r'avatar'] = avatar;
}
if (value != null) {
json[r'value'] = value;
}
if (attributes.isNotEmpty) {
json[r'attributes'] =
attributes.map((v) => LocalApiClient.serialize(v)).toList();
}
return json;
}