TomItem class

One item: the record of D1 §3.1.

Mutable, like the 3.x TomTodo it replaces (copy for a detached value, copyWith for a changed one); equal when every field is equal. WebworkSection extends it inside Webwork.

due, start and completedDate are date-only (UTC midnight of the day). created and updated keep what they are given: a value with no time of day is a date and is written as one, any other value is written as a UTC timestamp. estimate is a verbatim ISO-8601 duration.

Members marked deprecated are the 3.x TomTodo names; each says what replaces it.

Constructors

TomItem({required String id, String? headline, @Deprecated('Use headline') String? title, List<String> itemTypes = const [TomTodoItemTypes.todo], String? summary, String? description, List<String> categories = const [], List<String> tags = const [], TomTodoStatus status = TomTodoStatus.notStarted, TomTodoPriority? priority, bool flag = false, DateTime? start, DateTime? due, String? estimate, List<TomItemReminder> reminders = const [], TomTodoRepeat? repeat, String? nextRepeat, int? repeatCount, TomTodoRepeat? remind, String? nextRemind, int? remindCount, DateTime? completedDate, String? completedBy, List<String> dependencies = const [], List<String> blockedBy = const [], List<String> blocking = const [], List<String> blockedUntil = const [], List<String> comprisedOf = const [], List<TomItemAddress> assignees = const [], List<TomItemMembership> memberships = const [], TomItemLinks? links, @Deprecated('Use links.external') List<TomTodoReference>? references, String? source, String? notes, DateTime? created, DateTime? updated, String? author, String? editedBy, String? bodyType, Object? body, Map<String, Object?>? presentation, bool template = false, TomItemContainer? container, TomItemPeople? people, TomItemMail? mail, TomItemWorkflow? workflow, @Deprecated('Use workflow.decisions') List<TomTodoDecision>? decisions, @Deprecated('Use workflow.userAction') bool? userAction, @Deprecated('Use workflow.scope') TomTodoScope? scope, @Deprecated('Use workflow.executionRole') String? executionRole, @Deprecated('Use workflow.qaRole') String? qaRole, @Deprecated('Use workflow.orchestrationRole') String? orchestrationRole, @Deprecated('Use workflow.bundleId') String? bundleId, @Deprecated('Use workflow.derivedFrom') String? derivedFrom, @Deprecated('Use workflow.feedbackSource') String? feedbackSource, @Deprecated('Use workflow.filedBy') TomTodoFiledBy? filedBy, @Deprecated('Use workflow.onDone') TomTodoOnDone? onDone, @Deprecated('Use workflow.lastAnswer') String? lastAnswer, @Deprecated('Use workflow.resources') List<String>? resources, @Deprecated('Use workflow.claimHold') bool? claimHold, @Deprecated('Use workflow.claimFree') bool? claimFree, @Deprecated('Use workflow.dueReminded') String? dueReminded, @Deprecated('Use workflow.archived') DateTime? archived, @Deprecated('Use workflow.deleted') DateTime? deleted})

Properties

archived ↔ DateTime?
getter/setter pair
assignees ↔ List<TomItemAddress>
Who is to do it.
getter/setter pair
author ↔ String?
Who created it, who edited it last.
getter/setter pair
blockedBy ↔ List<String>
What it waits for: todo ids or <quest>/<todo> / D1 references.
getter/setter pair
blockedUntil ↔ List<String>
Publish conditions <package> >= <x.y.z>.
getter/setter pair
blocking ↔ List<String>
The reverse of blockedBy. Derived: in todo files the VS Code extension keeps it in step; elsewhere it is computed and never written.
getter/setter pair
body ↔ Object?
The content beyond the description: a map for a Webwork vendor type, a string for a text type or base64 text.
getter/setter pair
bodyType ↔ String?
The MIME type of body (D1 §3.6); null on a light item.
getter/setter pair
bundleId ↔ String?
getter/setter pair
categories ↔ List<String>
Hierarchical, inherited along the tree.
getter/setter pair
claimFree ↔ bool
getter/setter pair
claimHold ↔ bool
getter/setter pair
completedBy ↔ String?
Who did it.
getter/setter pair
completedDate ↔ DateTime?
When it was done; date-only.
getter/setter pair
comprisedOf ↔ List<String>
A group's members, in order.
getter/setter pair
container ↔ TomItemContainer?
getter/setter pair
created ↔ DateTime?
Created / last changed. A value with no time of day is a date.
getter/setter pair
decisions ↔ List<TomTodoDecision>
getter/setter pair
deleted ↔ DateTime?
getter/setter pair
dependencies ↔ List<String>
What must finish first (an ordering).
getter/setter pair
derivedFrom ↔ String?
getter/setter pair
description ↔ String?
Markdown text (CommonMark with GitHub extensions).
getter/setter pair
due ↔ DateTime?
The due day, always UTC midnight. Setting another day clears the workflow's due_reminded, so the new day gets its own reminder.
getter/setter pair
dueReminded ↔ String?
getter/setter pair
editedBy ↔ String?
getter/setter pair
estimate ↔ String?
A verbatim ISO-8601 duration.
getter/setter pair
executionRole ↔ String?
getter/setter pair
feedbackSource ↔ String?
getter/setter pair
filedBy ↔ TomTodoFiledBy?
getter/setter pair
flag ↔ bool
Flagged by the user.
getter/setter pair
hasBlocker → bool
True when a blocker is recorded — an item reference or a publish condition.
no setter
hashCode → int
The hash code for this object.
no setteroverride
hasOpenDecision → bool
True while at least one decision has no answer.
no setter
headline ↔ String
The one-line title (a todo file's title).
getter/setter pair
id → String
The item's identity: a UUID for items born in Webwork, the date-code id for workspace todos (D1 §2.3).
final
isDone → bool
True for the done group: completed and cancelled.
no setter
isGroup → bool
True for a todo group.
no setter
isRepeated → bool
True for an item with a repeat rule.
no setter
itemTypes ↔ List<String>
The stored item types, as wire names (unknown ones kept verbatim): see TomTodoItemTypes. types answers the computed ones too.
getter/setter pair
lastAnswer ↔ String?
getter/setter pair
External links and related items.
getter/setter pair
mail ↔ TomItemMail?
getter/setter pair
memberships ↔ List<TomItemMembership>
The lists, journals and mindmaps it appears in besides its home.
getter/setter pair
nextRemind ↔ String?
When the remind rule rings next, yyyy-MM-ddTHH:MM with Z or an offset, verbatim; absent once the rule has ended. Written before the reminder is sent, so it rings once across devices.
getter/setter pair
nextRepeat ↔ String?
When a waiting-for-repeat item is due again, verbatim.
getter/setter pair
notes ↔ String?
Free-form context.
getter/setter pair
onDone ↔ TomTodoOnDone?
getter/setter pair
orchestrationRole ↔ String?
getter/setter pair
people ↔ TomItemPeople?
getter/setter pair
presentation ↔ Map<String, Object?>?
How the body is shown (D22); null when absent.
getter/setter pair
priority ↔ TomTodoPriority?
getter/setter pair
qaRole ↔ String?
getter/setter pair
references ↔ List<TomTodoReference>
The 3.x name of TomItemLinks.external.
getter/setter pair
remind ↔ TomTodoRepeat?
The rule an open item keeps reminding by (the repeat rule forms but manual); it rings at each moment the rule names until it is done, cancelled or the rule ends. Independent of repeat.
getter/setter pair
remindCount ↔ int?
How many reminders the remind rule has sent.
getter/setter pair
reminders ↔ List<TomItemReminder>
When the item rings, in the order they were added.
getter/setter pair
repeat ↔ TomTodoRepeat?
The rule a repeated item comes back by.
getter/setter pair
repeatCount ↔ int?
How many times it has been done and repeated.
getter/setter pair
resources ↔ List<String>?
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scope ↔ TomTodoScope?
getter/setter pair
source ↔ String?
The external anchor <scheme>:<rest>.
getter/setter pair
start ↔ DateTime?
The day the item may be begun; date-only.
getter/setter pair
status ↔ TomTodoStatus
The status: a todo status, group, or TomTodoStatus.none for an item that is currently not treated as a todo.
getter/setter pair
summary ↔ String?
An optional one-line abstract.
getter/setter pair
tags ↔ List<String>
Flat labels, not inherited.
getter/setter pair
template ↔ bool
This item is a template.
getter/setter pair
title ↔ String
The 3.x name of headline.
getter/setter pair
updated ↔ DateTime?
getter/setter pair
userAction ↔ bool
getter/setter pair
workflow ↔ TomItemWorkflow?
getter/setter pair

Methods

addType(TomItemType type) → void
Adds the stored type type. A computed type cannot be added: it follows from the field named in the error.
changeStatus(TomTodoStatus next, {required DateTime on, String? by}) → void
Moves the item to next on the day of on, keeping the completion facts true: entering completed records completed_date and completed_by (by); leaving it clears both. updated is stamped with the day. Moving to the status it already has changes nothing.
check() → void
Validates the fields with a form: estimate, blockedUntil, nextRepeat, repeatCount, remind, nextRemind, remindCount and the workflow's.
copy() → TomItem
A detached deep copy carrying the same id.
copyWith({String? headline, List<String>? itemTypes, String? summary, String? description, List<String>? categories, List<String>? tags, TomTodoStatus? status, TomTodoPriority? priority, bool? flag, DateTime? start, DateTime? due, String? estimate, List<TomItemReminder>? reminders, TomTodoRepeat? repeat, String? nextRepeat, int? repeatCount, TomTodoRepeat? remind, String? nextRemind, int? remindCount, DateTime? completedDate, String? completedBy, List<String>? dependencies, List<String>? blockedBy, List<String>? blocking, List<String>? blockedUntil, List<String>? comprisedOf, List<TomItemAddress>? assignees, List<TomItemMembership>? memberships, TomItemLinks? links, String? source, String? notes, DateTime? created, DateTime? updated, String? author, String? editedBy, String? bodyType, Object? body, Map<String, Object?>? presentation, bool? template, TomItemContainer? container, TomItemPeople? people, TomItemMail? mail, TomItemWorkflow? workflow}) → TomItem
A copy with the given fields replaced. A field cannot be cleared here: take copy and set it to null.
hasStoredType(TomItemType type) → bool
Whether the stored type type is set.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
recordCreation({required DateTime on, String? author}) → void
Records that this item was written on the day of on by author (a null author leaves author absent).
removeType(TomItemType type) → void
Removes the stored type type; a computed type is refused.
toMap() → Map<String, Object?>
The item in the flat todo-file form, set fields only, in fields order. Nothing set is lost: every field that holds something is here. status is always written; resources: [] is kept (it claims nothing); the stored type todo alone — what every todo-file item is — is not written.
toString() → String
A string representation of this object.
override
types([TomItemTypeContext context = const TomItemTypeContext()]) → Set<TomItemType>
Every type of the item: the stored ones in itemTypes (in TomItemType order) and the computed ones — journal-entry from a membership in a journal, mindmap-node from a home in or a membership of a mindmap, email from the mail extension. A membership's container kind comes from context; without it, only email can be computed. Read-only: the set is a fresh value.

Operators

operator ==(Object other) → bool
Equal when every field is equal (the flat forms are).
override

Static Methods

checkBlockedUntil(String condition) → void
Validates one blocked_until condition (<package> >= <x.y.z>).
decodeDate(Object value, {String field = 'due'}) → DateTime
Parses a stored date field, rejecting anything that is not date-only.
decodeDateOrTime(Object value, {required String field}) → DateTime
Parses created / updated: a date or a timestamp with its zone.
encodeDate(DateTime date) → String
yyyy-MM-dd, the day date names from its own fields.
encodeDateOrTime(DateTime value) → String
A date when value has no time of day (in its own fields), else the UTC timestamp yyyy-MM-ddTHH:MM:SS[.fff]Z.
fromMap(Map map) → TomItem
Parses an item in the flat todo-file form. A key outside fields is a format error. An absent title reads as empty, an absent status as not-started, an absent item_types as [todo]; a computed type in item_types is ignored.

Constants

baseFields → const List<String>
The base fields outside the groups, in recordFields order.
dependencyFields → const List<String>
The dependencies: group (D1 §3.5.2), with the derived blocking the todo files carry.
fields → const Set<String>
The flat todo-file form: every field of the item under its key, in the order a key added to a todo file is placed. title is headline, references the external links, related the related ones; the workflow fields and the planning and dependency fields are top-level keys; children, people and mail are mappings. The workspace todo schema has exactly these properties (_bin/check_todo_model.py).
planningFields → const List<String>
The planning: group (D1 §3.5.1).
recordFields → const List<String>
The record's top-level keys in D1 §3.1 order (the D1 codec's field-order table).