ChatPhoto.fromJson constructor

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

Parse from a json

Implementation

factory ChatPhoto.fromJson(Map<String, dynamic> json) => ChatPhoto(
  id: int.parse(json['id']),
  addedDate: json['added_date'],
  minithumbnail: json['minithumbnail'] == null ? null : Minithumbnail.fromJson(json['minithumbnail']),
  sizes: List<PhotoSize>.from((json['sizes'] ?? []).map((item) => PhotoSize.fromJson(item)).toList()),
  animation: json['animation'] == null ? null : AnimatedChatPhoto.fromJson(json['animation']),
);