PageTableCell.deserialize constructor

PageTableCell.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory PageTableCell.deserialize(BinaryReader reader) {
  // Read [PageTableCell] fields.
  final flags = reader.readInt32();
  final header = (flags & 1) != 0;
  final alignCenter = (flags & 8) != 0;
  final alignRight = (flags & 16) != 0;
  final valignMiddle = (flags & 32) != 0;
  final valignBottom = (flags & 64) != 0;
  final hasTextField = (flags & 128) != 0;
  final text = hasTextField ? reader.readObject() as RichTextBase : null;
  final hasColspanField = (flags & 2) != 0;
  final colspan = hasColspanField ? reader.readInt32() : null;
  final hasRowspanField = (flags & 4) != 0;
  final rowspan = hasRowspanField ? reader.readInt32() : null;

  // Construct [PageTableCell] object.
  final returnValue = PageTableCell(
    header: header,
    alignCenter: alignCenter,
    alignRight: alignRight,
    valignMiddle: valignMiddle,
    valignBottom: valignBottom,
    text: text,
    colspan: colspan,
    rowspan: rowspan,
  );

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