ThumbnailFormat.fromJson constructor

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

Implementation

factory ThumbnailFormat.fromJson(Map<String, dynamic> json) {
  switch (json["@type"]) {
    case ThumbnailFormatJpeg.CONSTRUCTOR:
      return ThumbnailFormatJpeg.fromJson(json);
    case ThumbnailFormatGif.CONSTRUCTOR:
      return ThumbnailFormatGif.fromJson(json);
    case ThumbnailFormatMpeg4.CONSTRUCTOR:
      return ThumbnailFormatMpeg4.fromJson(json);
    case ThumbnailFormatPng.CONSTRUCTOR:
      return ThumbnailFormatPng.fromJson(json);
    case ThumbnailFormatTgs.CONSTRUCTOR:
      return ThumbnailFormatTgs.fromJson(json);
    case ThumbnailFormatWebm.CONSTRUCTOR:
      return ThumbnailFormatWebm.fromJson(json);
    case ThumbnailFormatWebp.CONSTRUCTOR:
      return ThumbnailFormatWebp.fromJson(json);
    default:
      return const ThumbnailFormat();
  }
}