Rebuild Home around a forest header with streak, score and water
Home now opens on a deep green header: greeting, a Today / Weekly toggle, a seven-day streak with a leaf on every kept day, minutes held with a + ring, plan thumbnails, the report-card letter as the score, and one bar per commitment class (weekly view swaps in per-day bars and class rates). The + opens an "Add to today" sheet over the blurred day. A water tracker sits below the header, kept on the device. The nav marks the selected tab as a filled block and drops the side action button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
This commit is contained in:
@@ -41,6 +41,8 @@ class InternalMemory implements ConnectInternalMemory {
|
||||
|
||||
static const String AMNESTY_SPENT = "AMNESTY_SPENT_Jr4xVh9KmT3gLc6B";
|
||||
|
||||
static const String WATER = "WATER_Qe7tNd4ZsM2kBv9C";
|
||||
|
||||
static const String TODOS = "TODOS_Wm3kRb8TqZ5nHc2F";
|
||||
|
||||
static const String SHOW_ONBOARDING = "SHOW_ONBOARDING_Nz6qGf2SdX7wPb4M";
|
||||
@@ -255,6 +257,31 @@ class InternalMemory implements ConnectInternalMemory {
|
||||
await groundedStorage.write(key: AMNESTY_SPENT, value: spent.toString());
|
||||
}
|
||||
|
||||
String _today() {
|
||||
final DateTime now = DateTime.now();
|
||||
return "${now.year}-${now.month}-${now.day}";
|
||||
}
|
||||
|
||||
@override
|
||||
Future<int> getWaterToday() async {
|
||||
String? value = await groundedStorage.read(key: WATER);
|
||||
|
||||
if (value != null) {
|
||||
final Map<String, dynamic> entry = jsonDecode(value);
|
||||
if (entry['day'] == _today()) {
|
||||
return entry['ml'] ?? 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@override
|
||||
Future setWaterToday(int ml) async {
|
||||
await groundedStorage.write(
|
||||
key: WATER, value: jsonEncode({'day': _today(), 'ml': ml}));
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<TodoItem>> getTodos() async {
|
||||
String? value = await groundedStorage.read(key: TODOS);
|
||||
|
||||
Reference in New Issue
Block a user