BusinessLocation.deserialize constructor

BusinessLocation.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory BusinessLocation.deserialize(BinaryReader reader) {
  // Read [BusinessLocation] fields.
  final flags = reader.readInt32();
  final hasGeoPointField = (flags & 1) != 0;
  final geoPoint =
      hasGeoPointField ? reader.readObject() as GeoPointBase : null;
  final address = reader.readString();

  // Construct [BusinessLocation] object.
  final returnValue = BusinessLocation(geoPoint: geoPoint, address: address);

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