Add routines module and full goal management

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
This commit is contained in:
alvocool
2026-11-02 08:45:41 +03:00
parent c88887b639
commit 1a5867a98f
49 changed files with 5384 additions and 220 deletions

View File

@@ -28,6 +28,7 @@ import '../excuse/ExcuseReport.dart';
import '../goal/Goals.dart';
import '../overdue/OverdueQueue.dart';
import '../reportcard/ReportCardScreen.dart';
import '../routine/Routines.dart';
import '../settings/Settings.dart';
import '../training/Training.dart';
import 'ConnectHome.dart';
@@ -136,6 +137,11 @@ class HomeState extends State<Home> implements ConnectHome {
.navigateToPage(NavigatorType.justOpen, const Training(), context);
}
void _onOpenRoutines() {
GroundedNavigation()
.navigateToPage(NavigatorType.justOpen, const Routines(), context);
}
void _onOpenSettings() {
GroundedNavigation()
.navigateToPage(NavigatorType.justOpen, const Settings(), context);
@@ -588,30 +594,46 @@ class HomeState extends State<Home> implements ConnectHome {
}
Widget _quickLinks() {
return Row(
return Column(
children: [
Expanded(
child: _quickLink(
CupertinoIcons.flag_fill,
"Goals",
_onOpenGoals,
),
Row(
children: [
Expanded(
child: _quickLink(
CupertinoIcons.flag_fill,
"Goals",
_onOpenGoals,
),
),
const SizedBox(width: 10),
Expanded(
child: _quickLink(
CupertinoIcons.square_stack_3d_up_fill,
"Routines",
_onOpenRoutines,
),
),
],
),
const SizedBox(width: 10),
Expanded(
child: _quickLink(
CupertinoIcons.chart_bar_alt_fill,
"Report",
_onOpenReportCard,
),
),
const SizedBox(width: 10),
Expanded(
child: _quickLink(
CupertinoIcons.flame_fill,
"Training",
_onOpenTraining,
),
const SizedBox(height: 10),
Row(
children: [
Expanded(
child: _quickLink(
CupertinoIcons.flame_fill,
"Training",
_onOpenTraining,
),
),
const SizedBox(width: 10),
Expanded(
child: _quickLink(
CupertinoIcons.chart_bar_alt_fill,
"Report",
_onOpenReportCard,
),
),
],
),
],
);