首次远程推送

This commit is contained in:
2026-09-27 23:40:22 +08:00
parent 2e0bf3c784
commit 8afa47952a
70 changed files with 8603 additions and 4502 deletions
+6 -6
View File
@@ -1,6 +1,5 @@
import '../core/date_keys.dart';
import 'app_state.dart';
import 'growth_stage.dart';
class TodayProgress {
const TodayProgress({
@@ -10,7 +9,6 @@ class TodayProgress {
required this.completedHabits,
required this.totalHabits,
required this.hasReflection,
required this.growthStage,
});
factory TodayProgress.fromState(AppState state, String dateKey) {
@@ -23,8 +21,11 @@ class TodayProgress {
.where((habit) => habit.completedDates.contains(dateKey))
.length,
totalHabits: state.habits.length,
hasReflection: state.reflections.any((entry) => entry.dateKey == dateKey),
growthStage: growthStageFor(state, dateKey),
hasReflection:
state.reflections.any((entry) => entry.dateKey == dateKey) ||
state.progressNotes.any(
(entry) => entry.dateKey == dateKey && entry.hasContent,
),
);
}
@@ -34,16 +35,15 @@ class TodayProgress {
final int completedHabits;
final int totalHabits;
final bool hasReflection;
final GrowthStage growthStage;
bool get hasIntention => intention.isNotEmpty;
bool get hasFocus => focusMinutes > 0;
bool get hasHabits => completedHabits > 0;
bool get isLoopClosed => hasIntention && hasFocus && hasReflection;
int get completedSteps =>
[
hasIntention,
hasFocus,
hasHabits,
hasReflection,
].where((complete) => complete).length;
}