Story.fromJson constructor
Parses a Story from TDLib JSON.
Implementation
factory Story.fromJson(Map<String, dynamic> json) => Story(
id: _readInt(json['id']),
posterChatId: _readInt(json['poster_chat_id']),
posterId: _readOptional(json['poster_id'], MessageSender.fromJson),
date: _readInt(json['date']),
isBeingPosted: _readBool(json['is_being_posted']),
isBeingEdited: _readBool(json['is_being_edited']),
isEdited: _readBool(json['is_edited']),
isPostedToChatPage: _readBool(json['is_posted_to_chat_page']),
isVisibleOnlyForSelf: _readBool(json['is_visible_only_for_self']),
canBeAddedToAlbum: _readBool(json['can_be_added_to_album']),
canBeDeleted: _readBool(json['can_be_deleted']),
canBeEdited: _readBool(json['can_be_edited']),
canBeForwarded: _readBool(json['can_be_forwarded']),
canBeReplied: _readBool(json['can_be_replied']),
canSetPrivacySettings: _readBool(json['can_set_privacy_settings']),
canToggleIsPostedToChatPage: _readBool(
json['can_toggle_is_posted_to_chat_page'],
),
canGetStatistics: _readBool(json['can_get_statistics']),
canGetInteractions: _readBool(json['can_get_interactions']),
hasExpiredViewers: _readBool(json['has_expired_viewers']),
repostInfo: _readOptional(json['repost_info'], StoryRepostInfo.fromJson),
interactionInfo: _readOptional(
json['interaction_info'],
StoryInteractionInfo.fromJson,
),
chosenReactionType: _readOptional(
json['chosen_reaction_type'],
ReactionType.fromJson,
),
privacySettings: _readObject(
json['privacy_settings'],
StoryPrivacySettings.fromJson,
),
content: _readObject(json['content'], StoryContent.fromJson),
areas: _readList<StoryArea>(
json['areas'],
(e) => _readObject(e, StoryArea.fromJson),
),
caption: _readObject(json['caption'], FormattedText.fromJson),
albumIds: _readList<int>(json['album_ids'], _readInt),
extra: json['@extra'],
clientId: _readClientId(json['@client_id']),
);