Game.fromJson constructor
De-serializes a Game object from a JSON map
Implementation
factory Game.fromJson(Map<String, dynamic> json) {
return Game(
title: json['title'] as String,
description: json['description'] as String,
photo: (json['photo'] as List<dynamic>)
.map((e) => PhotoSize.fromJson(e as Map<String, dynamic>))
.toList(),
text: json['text'] as String?,
textEntities: (json['text_entities'] as List<dynamic>?)
?.map((e) => MessageEntity.fromJson(e as Map<String, dynamic>))
.toList(),
animation: json['animation'] == null
? null
: Animation.fromJson(json['animation'] as Map<String, dynamic>),
);
}