UpdateUserTyping.deserialize constructor

UpdateUserTyping.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory UpdateUserTyping.deserialize(BinaryReader reader) {
  // Read [UpdateUserTyping] fields.
  final flags = reader.readInt32();
  final userId = reader.readInt64();
  final hasTopMsgIdField = (flags & 1) != 0;
  final topMsgId = hasTopMsgIdField ? reader.readInt32() : null;
  final action = reader.readObject() as SendMessageActionBase;

  // Construct [UpdateUserTyping] object.
  final returnValue = UpdateUserTyping(
    userId: userId,
    topMsgId: topMsgId,
    action: action,
  );

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