toJson method
Returns a JSON-compatible representation of the internal data structure. For the returned format, see the fromDynamic function.
Implementation
@override
Map<String, dynamic> toJson() => {
'id': id,
if (image != null) 'image': base64Encode(image ?? <int>[]),
if (values?.isNotEmpty == true) 'values': values,
};