ContactsGetLocated.deserialize constructor

ContactsGetLocated.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory ContactsGetLocated.deserialize(BinaryReader reader) {
  // Read [ContactsGetLocated] fields.
  final flags = reader.readInt32();
  final background = (flags & 2) != 0;
  final geoPoint = reader.readObject() as InputGeoPointBase;
  final hasSelfExpiresField = (flags & 1) != 0;
  final selfExpires = hasSelfExpiresField ? reader.readInt32() : null;

  // Construct [ContactsGetLocated] object.
  final returnValue = ContactsGetLocated(
    background: background,
    geoPoint: geoPoint,
    selfExpires: selfExpires,
  );

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