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
+14
View File
@@ -24,6 +24,12 @@ final dailyAveragesProvider = FutureProvider.autoDispose
ref.watch(moodDaoProvider).getDailyAverages(range.start, range.end),
);
// ── Is this the first entry today? ───────────────────────────────────────────
final isFirstEntryTodayProvider = FutureProvider.autoDispose<bool>((ref) async {
return !(await ref.read(moodDaoProvider).hasEntryToday());
});
// ── Selected day (drives calendar + day detail) ───────────────────────────────
class SelectedDay extends Notifier<DateTime> {
@@ -55,6 +61,10 @@ class MoodEntryNotifier extends Notifier<AsyncValue<void>> {
List<int> activityIds = const [],
List<int> tagIds = const [],
DateTime? timestamp,
int? sleepMinutes,
int? energyLevel,
int? positivityLevel,
int? selfWorthLevel,
}) async {
state = const AsyncLoading();
final next = await AsyncValue.guard(() async {
@@ -64,6 +74,10 @@ class MoodEntryNotifier extends Notifier<AsyncValue<void>> {
moodLevel: moodLevel,
timestamp: timestamp ?? DateTime.now(),
note: Value(note),
sleepMinutes: Value(sleepMinutes),
energyLevel: Value(energyLevel),
positivityLevel: Value(positivityLevel),
selfWorthLevel: Value(selfWorthLevel),
),
activityIds: activityIds,
tagIds: tagIds,