toJson method
Implementation
@override
Map<String, dynamic> toJson() {
return {
'type': type,
'payload': payload.toJson(),
if (thumbnail != null) 'thumbnail': thumbnail,
if (width != null) 'width': width,
if (height != null) 'height': height,
if (duration != null) 'duration': duration,
};
}