TodoList.deserialize constructor

TodoList.deserialize(
  1. BinaryReader reader
)

Deserialize.

Implementation

factory TodoList.deserialize(BinaryReader reader) {
  // Read [TodoList] fields.
  final flags = reader.readInt32();
  final othersCanAppend = (flags & 1) != 0;
  final othersCanComplete = (flags & 2) != 0;
  final title = reader.readObject() as TextWithEntitiesBase;
  final list = reader.readVectorObject<TodoItemBase>();

  // Construct [TodoList] object.
  final returnValue = TodoList(
    othersCanAppend: othersCanAppend,
    othersCanComplete: othersCanComplete,
    title: title,
    list: list.items,
  );

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