MessageMediaDice.deserialize constructor
MessageMediaDice.deserialize(
- BinaryReader reader
Deserialize.
Implementation
factory MessageMediaDice.deserialize(BinaryReader reader) {
// Read [MessageMediaDice] fields.
final flags = reader.readInt32();
final value = reader.readInt32();
final emoticon = reader.readString();
final hasGameOutcomeField = (flags & 1) != 0;
final gameOutcome = hasGameOutcomeField
? reader.readObject() as MessagesEmojiGameOutcomeBase
: null;
// Construct [MessageMediaDice] object.
final returnValue = MessageMediaDice(
value: value,
emoticon: emoticon,
gameOutcome: gameOutcome,
);
// Now return the deserialized [MessageMediaDice].
return returnValue;
}