BotApp.deserialize constructor
BotApp.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory BotApp.deserialize(BinaryReader reader) {
// Read [BotApp] fields.
final flags = reader.readInt32();
final id = reader.readInt64();
final accessHash = reader.readInt64();
final shortName = reader.readString();
final title = reader.readString();
final description = reader.readString();
final photo = reader.readObject() as PhotoBase;
final hasDocumentField = (flags & 1) != 0;
final document =
hasDocumentField ? reader.readObject() as DocumentBase : null;
final hash = reader.readInt64();
// Construct [BotApp] object.
final returnValue = BotApp(
id: id,
accessHash: accessHash,
shortName: shortName,
title: title,
description: description,
photo: photo,
document: document,
hash: hash,
);
// Now return the deserialized [BotApp].
return returnValue;
}