GiphyAssets.fromJson constructor
Creates a GiphyAssets instance from a JSON object.
The json
parameter must not be null and should contain valid key-value pairs
corresponding to the different resolutions.
Implementation
factory GiphyAssets.fromJson(Map<Object?, Object?> json) {
return GiphyAssets(
source: json['source'] != null
? GiphyAsset.fromJson(json['source'] as Map<Object?, Object?>)
: null,
size360p: json['360p'] != null
? GiphyAsset.fromJson(json['360p'] as Map<Object?, Object?>)
: null,
size480p: json['480p'] != null
? GiphyAsset.fromJson(json['480p'] as Map<Object?, Object?>)
: null,
size720p: json['720p'] != null
? GiphyAsset.fromJson(json['720p'] as Map<Object?, Object?>)
: null,
size1080p: json['1080p'] != null
? GiphyAsset.fromJson(json['1080p'] as Map<Object?, Object?>)
: null,
size4k: json['4k'] != null
? GiphyAsset.fromJson(json['4k'] as Map<Object?, Object?>)
: null,
);
}