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
45 lines
1.1 KiB
Dart
45 lines
1.1 KiB
Dart
/// What a routine is for. The kind decides the runner's stage — a barbell
|
|
/// clock for work, a breathing circle for stillness, a checklist for the
|
|
/// things that simply have to get done.
|
|
enum RoutineKind {
|
|
/// Sets, reps and rest. Timed work auto-advances into rest.
|
|
Workout,
|
|
|
|
/// Long timed holds with a breathing cue. No reps, rarely any rest.
|
|
Meditation,
|
|
|
|
/// An ordered list of tasks that have to be done, in order, every time.
|
|
MustDo,
|
|
}
|
|
|
|
String kindLabel(RoutineKind value) {
|
|
switch (value) {
|
|
case RoutineKind.Workout:
|
|
return "Workout";
|
|
case RoutineKind.Meditation:
|
|
return "Meditation";
|
|
case RoutineKind.MustDo:
|
|
return "Must-do";
|
|
}
|
|
}
|
|
|
|
String kindDescription(RoutineKind value) {
|
|
switch (value) {
|
|
case RoutineKind.Workout:
|
|
return "Sets, reps and timed rest.";
|
|
case RoutineKind.Meditation:
|
|
return "Timed sits with a breathing cue.";
|
|
case RoutineKind.MustDo:
|
|
return "Tasks, in order, every time.";
|
|
}
|
|
}
|
|
|
|
RoutineKind getRoutineKind(String? name) {
|
|
for (RoutineKind value in RoutineKind.values) {
|
|
if (value.name == name) {
|
|
return value;
|
|
}
|
|
}
|
|
return RoutineKind.Workout;
|
|
}
|