toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    if (description != null) 'description': description,
    'url': url,
    if (bytes != null) 'bytes': bytes!,
    if (spoiler != null) 'spoiler': spoiler,
    'media': {
      'url': url,
      if (proxyUrl != null) 'proxy_url': proxyUrl,
      if (height != null) 'height': height,
      if (width != null) 'width': width,
      if (contentType != null) 'content_type': contentType,
    },
  };
}