GiphyCollection.fromJson constructor

GiphyCollection.fromJson(
  1. Map<String, dynamic> json
)

Creates a new giphy collection from json

Implementation

factory GiphyCollection.fromJson(Map<String, dynamic> json) =>
    GiphyCollection(
      data: json.containsKey('data')
          // ignore: unnecessary_lambdas
          ? (json['data'] as List).map((e) => GiphyGif.fromJson(e)).toList()
          : [],
      pagination: json['pagination'] == null
          ? null
          : GiphyPagination.fromJson(
              json['pagination'] as Map<String, dynamic>),
      meta: json['meta'] == null
          ? null
          : GiphyMeta.fromJson(json['meta'] as Map<String, dynamic>),
    );