Photo.fromJson constructor

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

Parse from a json

Implementation

factory Photo.fromJson(Map<String, dynamic> json) => Photo(
      hasStickers: json['has_stickers'],
      minithumbnail: json['minithumbnail'] == null
          ? null
          : Minithumbnail.fromJson(json['minithumbnail']),
      sizes: List<PhotoSize>.from((json['sizes'] ?? [])
          .map((item) => PhotoSize.fromJson(item))
          .toList()),
    );