StickerSet.deserialize constructor

StickerSet.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory StickerSet.deserialize(BinaryReader reader) {
  // Read [StickerSet] fields.
  final flags = reader.readInt32();
  final archived = (flags & 2) != 0;
  final official = (flags & 4) != 0;
  final masks = (flags & 8) != 0;
  final animated = (flags & 32) != 0;
  final videos = (flags & 64) != 0;
  final emojis = (flags & 128) != 0;
  final textColor = (flags & 512) != 0;
  final channelEmojiStatus = (flags & 1024) != 0;
  final hasInstalledDateField = (flags & 1) != 0;
  final installedDate = hasInstalledDateField ? reader.readDateTime() : null;
  final id = reader.readInt64();
  final accessHash = reader.readInt64();
  final title = reader.readString();
  final shortName = reader.readString();
  final hasThumbsField = (flags & 16) != 0;
  final thumbs =
      hasThumbsField ? reader.readVectorObject<PhotoSizeBase>() : null;
  final hasThumbDcIdField = (flags & 16) != 0;
  final thumbDcId = hasThumbDcIdField ? reader.readInt32() : null;
  final hasThumbVersionField = (flags & 16) != 0;
  final thumbVersion = hasThumbVersionField ? reader.readInt32() : null;
  final hasThumbDocumentIdField = (flags & 256) != 0;
  final thumbDocumentId = hasThumbDocumentIdField ? reader.readInt64() : null;
  final count = reader.readInt32();
  final hash = reader.readInt32();

  // Construct [StickerSet] object.
  final returnValue = StickerSet(
    archived: archived,
    official: official,
    masks: masks,
    animated: animated,
    videos: videos,
    emojis: emojis,
    textColor: textColor,
    channelEmojiStatus: channelEmojiStatus,
    installedDate: installedDate,
    id: id,
    accessHash: accessHash,
    title: title,
    shortName: shortName,
    thumbs: thumbs,
    thumbDcId: thumbDcId,
    thumbVersion: thumbVersion,
    thumbDocumentId: thumbDocumentId,
    count: count,
    hash: hash,
  );

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