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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user