Add groups with shared goals, objectives and chat; drop the water tracker

Groups let people keep each other honest: create one or join with a
six-letter invite code. Each group has shared goals split into measurable
objectives (km, sessions, words) that every member logs toward, a
leaderboard of kept rate and streak with nudges, and a group chat where
check-ins and nudges appear as cards beside the talk. The open chat polls
for new messages.

Reached from a new Groups tab (Training moves into the day rail), a Home
"Your groups" rail that opens the chat, and a Group tile in the add sheet.
Mock mode seeds two groups, a joinable one and members who reply.

The water tracker is removed; it did not fit the app. Bottom sheets are
now square app-wide via the theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
This commit is contained in:
alvocool
2026-11-03 11:46:41 +03:00
parent 4548e1f164
commit 4b71257429
51 changed files with 3871 additions and 157 deletions

View File

@@ -138,9 +138,8 @@ const Color colorHeaderSelected = Color(0xFF3D6B53);
const Color colorBarNonNegotiable = Color(0xFFE8735A);
const Color colorBarStandard = Color(0xFFF2C14E);
const Color colorBarElective = Color(0xFF6FD39B);
// Water: filled drops and the empty ones.
const Color colorWater = Color(0xFF6E8EF0);
const Color colorWaterEmpty = Color(0xFFDDE1DE);
// The drag handle on white sheets.
const Color colorGrabber = Color(0xFFDDE1DE);
// ── Scene art ─────────────────────────────────────────────────────────────────
// The painted landscapes that stand in for photography on cards. Each kind has

View File

@@ -404,3 +404,20 @@ int sceneSeed(String key) {
}
return hash;
}
/// An amount the way a person reads it: whole numbers with thousands
/// separators, anything else to one decimal place.
String formatAmount(double value) {
if (value == value.roundToDouble()) {
final String digits = value.round().abs().toString();
final StringBuffer out = StringBuffer(value < 0 ? "-" : "");
for (int index = 0; index < digits.length; index++) {
if (index > 0 && (digits.length - index) % 3 == 0) {
out.write(",");
}
out.write(digits[index]);
}
return out.toString();
}
return value.toStringAsFixed(1);
}

View File

@@ -4,6 +4,11 @@ import '../about/external/data/DebtEntry.dart';
import '../about/external/data/ExcuseCluster.dart';
import '../about/external/data/ExercisePrescription.dart';
import '../about/external/data/Goal.dart';
import '../about/external/data/Group.dart';
import '../about/external/data/GroupGoal.dart';
import '../about/external/data/GroupMember.dart';
import '../about/external/data/GroupMessage.dart';
import '../about/external/data/GroupObjective.dart';
import '../about/external/data/Habit.dart';
import '../about/external/data/Program.dart';
import '../about/external/data/RoutineChain.dart';
@@ -122,3 +127,38 @@ List<String> getStringList(dynamic data) {
}
return (data as List).map((item) => item.toString()).toList();
}
List<Group> getGroupList(dynamic data) {
if (data == null) {
return <Group>[];
}
return (data as List).map((item) => Group.fromJson(item)).toList();
}
List<GroupMember> getGroupMemberList(dynamic data) {
if (data == null) {
return <GroupMember>[];
}
return (data as List).map((item) => GroupMember.fromJson(item)).toList();
}
List<GroupGoal> getGroupGoalList(dynamic data) {
if (data == null) {
return <GroupGoal>[];
}
return (data as List).map((item) => GroupGoal.fromJson(item)).toList();
}
List<GroupObjective> getGroupObjectiveList(dynamic data) {
if (data == null) {
return <GroupObjective>[];
}
return (data as List).map((item) => GroupObjective.fromJson(item)).toList();
}
List<GroupMessage> getGroupMessageList(dynamic data) {
if (data == null) {
return <GroupMessage>[];
}
return (data as List).map((item) => GroupMessage.fromJson(item)).toList();
}