WebPageAttributeStory.deserialize constructor

WebPageAttributeStory.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory WebPageAttributeStory.deserialize(BinaryReader reader) {
  // Read [WebPageAttributeStory] fields.
  final flags = reader.readInt32();
  final peer = reader.readObject() as PeerBase;
  final id = reader.readInt32();
  final hasStoryField = (flags & 1) != 0;
  final story = hasStoryField ? reader.readObject() as StoryItemBase : null;

  // Construct [WebPageAttributeStory] object.
  final returnValue = WebPageAttributeStory(peer: peer, id: id, story: story);

  // Now return the deserialized [WebPageAttributeStory].
  return returnValue;
}