InputBusinessRecipients.deserialize constructor

InputBusinessRecipients.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory InputBusinessRecipients.deserialize(BinaryReader reader) {
  // Read [InputBusinessRecipients] fields.
  final flags = reader.readInt32();
  final existingChats = (flags & 1) != 0;
  final newChats = (flags & 2) != 0;
  final contacts = (flags & 4) != 0;
  final nonContacts = (flags & 8) != 0;
  final excludeSelected = (flags & 32) != 0;
  final hasUsersField = (flags & 16) != 0;
  final users =
      hasUsersField ? reader.readVectorObject<InputUserBase>() : null;

  // Construct [InputBusinessRecipients] object.
  final returnValue = InputBusinessRecipients(
    existingChats: existingChats,
    newChats: newChats,
    contacts: contacts,
    nonContacts: nonContacts,
    excludeSelected: excludeSelected,
    users: users?.items,
  );

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