feat: implement multi-step mood logging wizard

Adds sleep/energy/positivity/self-worth tracking columns to the database
(schema v2 migration), a new 5-option StepScale widget, per-answer chips
at the top of the screen, a 2×2 activity grid chip, and a full step-by-step
wizard flow: mood → sleep (first entry today only) → energy → positivity →
self-worth → activities → review+save.
This commit is contained in:
2026-04-26 12:14:45 +10:00
parent 59597c7a4f
commit 6f3fb74e7e
10 changed files with 1142 additions and 129 deletions
+10
View File
@@ -74,6 +74,16 @@ class MoodDao extends DatabaseAccessor<AppDatabase> with _$MoodDaoMixin {
..orderBy([(t) => OrderingTerm.asc(t.timestamp)]))
.get();
Future<bool> hasEntryToday() async {
final today = DateTime.now();
final start = DateTime(today.year, today.month, today.day);
final end = start.add(const Duration(days: 1));
return (await (select(moodEntries)
..where((t) => t.timestamp.isBetweenValues(start, end))
..limit(1))
.getSingleOrNull()) != null;
}
// Average mood per day — used by calendar heatmap
Future<Map<DateTime, double>> getDailyAverages(
DateTime start, DateTime end) async {