AiComposeTone.deserialize constructor
AiComposeTone.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory AiComposeTone.deserialize(BinaryReader reader) {
// Read [AiComposeTone] fields.
final flags = reader.readInt32();
final creator = (flags & 1) != 0;
final id = reader.readInt64();
final accessHash = reader.readInt64();
final slug = reader.readString();
final title = reader.readString();
final hasEmojiIdField = (flags & 2) != 0;
final emojiId = hasEmojiIdField ? reader.readInt64() : null;
final hasPromptField = (flags & 16) != 0;
final prompt = hasPromptField ? reader.readString() : null;
final hasInstallsCountField = (flags & 4) != 0;
final installsCount = hasInstallsCountField ? reader.readInt32() : null;
final hasAuthorIdField = (flags & 8) != 0;
final authorId = hasAuthorIdField ? reader.readInt64() : null;
final hasExampleEnglishField = (flags & 32) != 0;
final exampleEnglish = hasExampleEnglishField
? reader.readObject() as AiComposeToneExampleBase
: null;
// Construct [AiComposeTone] object.
final returnValue = AiComposeTone(
creator: creator,
id: id,
accessHash: accessHash,
slug: slug,
title: title,
emojiId: emojiId,
prompt: prompt,
installsCount: installsCount,
authorId: authorId,
exampleEnglish: exampleEnglish,
);
// Now return the deserialized [AiComposeTone].
return returnValue;
}