fromJson static method

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

Implementation

static Animation? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return Animation(
    duration: (json['duration'] as int?) ?? 0,
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
    fileName: (json['file_name'] as String?) ?? '',
    mimeType: (json['mime_type'] as String?) ?? '',
    hasStickers: (json['has_stickers'] as bool?) ?? false,
    minithumbnail: Minithumbnail.fromJson(
      tdMapFromJson(json['minithumbnail']),
    ),
    thumbnail: Thumbnail.fromJson(tdMapFromJson(json['thumbnail'])),
    animation: File.fromJson(tdMapFromJson(json['animation'])),
  );
}