toJson method

Map<String, dynamic> toJson()

Converts the GiphyImages instance to a JSON object.

Returns a map containing key-value pairs corresponding to the image renditions.

Implementation

Map<String, dynamic> toJson() {
  return {
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedHeight):
        fixedHeight?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedHeightStill):
        fixedHeightStill?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedHeightDownsampled):
        fixedHeightDownsampled?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedWidth):
        fixedWidth?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedWidthStill):
        fixedWidthStill?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedWidthDownsampled):
        fixedWidthDownsampled?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedHeightSmall):
        fixedHeightSmall?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedHeightSmallStill):
        fixedHeightSmallStill?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedWidthSmall):
        fixedWidthSmall?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.fixedWidthSmallStill):
        fixedWidthSmallStill?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.downsized):
        downsized?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.downsizedStill):
        downsizedStill?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.downsizedLarge):
        downsizedLarge?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.downsizedMedium):
        downsizedMedium?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.original):
        original?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.originalStill):
        originalStill?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.looping):
        looping?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.preview):
        preview?.toJson(),
    GiphyRenditionUtil.toStringValue(GiphyRendition.downsizedSmall):
        downsizedSmall?.toJson(),
    'mediaId': mediaId,
  };
}