ChatPhoto.fromMap constructor

ChatPhoto.fromMap(
  1. Map<String, dynamic> map
)

Implementation

ChatPhoto.fromMap(Map<String, dynamic> map) {
  extra = map['@extra'];
  client_id = map['@client_id'];
  id = map['id'];
  added_date = map['added_date'];
  if (map['minithumbnail'] != null) {
    minithumbnail = TdApiMap.fromMap(map['minithumbnail']) as Minithumbnail;
  }
  if (map['sizes'] != null) {
    sizes = [];
    for (var someValue in map['sizes']) {
      if (someValue != null) {
        sizes?.add(TdApiMap.fromMap(someValue) as PhotoSize);
      }
    }
  }
  if (map['animation'] != null) {
    animation = TdApiMap.fromMap(map['animation']) as AnimatedChatPhoto;
  }
  if (map['small_animation'] != null) {
    small_animation = TdApiMap.fromMap(map['small_animation']) as AnimatedChatPhoto;
  }
}