Routines: workout, meditation and must-do routines with timed, rep and tick steps, sets and rest. A library screen, a builder with templates and drag-to-reorder steps, and a full-screen player that auto-advances timed phases, counts backgrounding and logs broken chains as partial. Goals: a goal editor (deadline, colour, category, default class, archive), routines linked to goals, and a goal field on tasks and routines. Tasks added from inside a goal are now actually attached to it via parentId. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
64 lines
1.2 KiB
Dart
64 lines
1.2 KiB
Dart
/// Create or update a commitment.
|
|
class CommitmentRequest {
|
|
String? id;
|
|
|
|
/// The goal this task belongs to; null for a loose task.
|
|
String? parentId;
|
|
|
|
String type;
|
|
|
|
String commitmentClass;
|
|
|
|
String title;
|
|
|
|
String category;
|
|
|
|
String dueStart;
|
|
|
|
String dueEnd;
|
|
|
|
int estMinutes;
|
|
|
|
String energy;
|
|
|
|
String proofType;
|
|
|
|
int proofTimerMinutes;
|
|
|
|
String rrule;
|
|
|
|
CommitmentRequest({
|
|
this.id,
|
|
this.parentId,
|
|
this.type = "TASK",
|
|
this.commitmentClass = "Standard",
|
|
this.title = "",
|
|
this.category = "",
|
|
this.dueStart = "",
|
|
this.dueEnd = "",
|
|
this.estMinutes = 0,
|
|
this.energy = "Medium",
|
|
this.proofType = "Honour",
|
|
this.proofTimerMinutes = 0,
|
|
this.rrule = "",
|
|
});
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['parentId'] = parentId;
|
|
data['type'] = type;
|
|
data['commitmentClass'] = commitmentClass;
|
|
data['title'] = title;
|
|
data['category'] = category;
|
|
data['dueStart'] = dueStart;
|
|
data['dueEnd'] = dueEnd;
|
|
data['estMinutes'] = estMinutes;
|
|
data['energy'] = energy;
|
|
data['proofType'] = proofType;
|
|
data['proofTimerMinutes'] = proofTimerMinutes;
|
|
data['rrule'] = rrule;
|
|
return data;
|
|
}
|
|
}
|