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 ThumbnailFormatPng.CONSTRUCTOR:
      return ThumbnailFormatPng.fromJson(json);
    case ThumbnailFormatWebp.CONSTRUCTOR:
      return ThumbnailFormatWebp.fromJson(json);
    case ThumbnailFormatGif.CONSTRUCTOR:
      return ThumbnailFormatGif.fromJson(json);
    case ThumbnailFormatTgs.CONSTRUCTOR:
      return ThumbnailFormatTgs.fromJson(json);
    case ThumbnailFormatMpeg4.CONSTRUCTOR:
      return ThumbnailFormatMpeg4.fromJson(json);
    default:
      return const ThumbnailFormat();
  }
}