ProtocolTask class

Represents a task in the protocol layer (headless).

Constructors

ProtocolTask({required String id, required String rowId, required DateTime start, required DateTime end, String? name, double completion = 0.0, bool isSummary = false, bool isMilestone = false, String? resourceId, String? parentId, String? notes, bool isDeleted = false, required Hlc lastUpdated, String? lastUpdatedBy, Map<String, Hlc> fieldTimestamps = const {}, Map<String, dynamic> metadata = const {}})
Creates a ProtocolTask with the given properties.
const
ProtocolTask.fromJson(Map<String, dynamic> json)
Creates a ProtocolTask instance from a JSON map.
factory

Properties

completion double
The completion percentage of the task (0.0 to 1.0).
final
contentHash String
Computes a deterministic SHA-256 hash of the task's content. Used for Merkle Tree computation to detect state differences.
no setter
end DateTime
The end time of the task (UTC).
final
fieldTimestamps Map<String, Hlc>
A map of field names to HLC timestamps, tracking the last update time for each field. Used for field-level Conflict Resolution (CRDT).
final
hashCode int
The hash code for this object.
no setterinherited
id String
The unique identifier for the task.
final
isDeleted bool
Whether the task has been marked as deleted (tombstone).
final
isMilestone bool
Whether this task represents a milestone (zero duration).
final
isSummary bool
Whether this task represents a summary of other tasks.
final
lastUpdated Hlc
The Hybrid Logical Clock timestamp of the last update to this task.
final
lastUpdatedBy String?
The ID of the actor who last updated this task.
final
metadata Map<String, dynamic>
Additional metadata for UI or implementation-specific fields (Color, etc). These are not part of the core comparison identity usually, but MIGHT be part of sync.
final
name String?
The display name of the task.
final
notes String?
Additional notes or description for the task.
final
parentId String?
The ID of the parent task, for hierarchical structures.
final
resourceId String?
The ID of the resource assigned to this task.
final
rowId String
The ID of the row this task belongs to.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
start DateTime
The start time of the task (UTC).
final

Methods

copyWith({String? id, String? rowId, DateTime? start, DateTime? end, String? name, double? completion, bool? isSummary, bool? isMilestone, String? resourceId, String? parentId, String? notes, bool? isDeleted, Hlc? lastUpdated, String? lastUpdatedBy, Map<String, Hlc>? fieldTimestamps, Map<String, dynamic>? metadata}) ProtocolTask
Creates a copy of this task with the given fields replaced with new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts the ProtocolTask to a JSON map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited