BusinessWorkHours.deserialize constructor

BusinessWorkHours.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory BusinessWorkHours.deserialize(BinaryReader reader) {
  // Read [BusinessWorkHours] fields.
  final flags = reader.readInt32();
  final openNow = (flags & 1) != 0;
  final timezoneId = reader.readString();
  final weeklyOpen = reader.readVectorObject<BusinessWeeklyOpenBase>();

  // Construct [BusinessWorkHours] object.
  final returnValue = BusinessWorkHours(
    openNow: openNow,
    timezoneId: timezoneId,
    weeklyOpen: weeklyOpen.items,
  );

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