Files
GroundedHelper/frontend/lib/Grounded/see/group/ViewGroupDetail.dart
alvocool d3431ca5de Switch to Inter, round the corners softly and make the nav switch tabs
Inter replaces General Sans (Inter Display for titles and big numbers).
Corners come back from before the squaring commit, scaled to a soft set
(16 cards, 14 buttons, 12 rows, 8 chips) and applied to the screens built
since. The nav is now a cluster of round frosted buttons that switches
Today, Routines, Goals, Groups and Progress in place inside Home: no
pushed pages, no back arrows, and Android back returns to Today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhQh614DMeYoQEH9SoMRUw
2026-11-09 07:08:46 +03:00

78 lines
2.2 KiB
Dart

import '../../about/external/data/Group.dart';
import '../../about/external/initial/IdRequest.dart';
import '../../about/external/initial/NudgeRequest.dart';
import '../../about/external/initial/ObjectiveProgressRequest.dart';
import '../parent/ParentViewModel.dart';
import 'ConnectGroupDetail.dart';
class ViewGroupDetail extends ParentViewModel {
ConnectGroupDetail connection;
ViewGroupDetail(super.context, this.connection);
/// [quiet] refreshes behind the screen without the loading overlay, for
/// coming back from the chat or the goal editor.
void loadGroup(String groupId, {bool quiet = false}) async {
if (!await hasNetwork(() => loadGroup(groupId, quiet: quiet))) return;
if (!quiet) showLoading("Loading the group");
try {
final response =
await getDataManager().getGroupEntry(IdRequest(id: groupId));
if (!quiet) closeLoading();
connection.onGroupLoaded(Group.fromJson(response.data));
} catch (e) {
handleError(e, () => loadGroup(groupId, quiet: quiet),
() => dismissError(), "Retry");
}
}
void logProgress(ObjectiveProgressRequest request, String summary) async {
if (!await hasNetwork(() => logProgress(request, summary))) return;
showLoading("Logging");
try {
final response = await getDataManager().logObjectiveProgress(request);
closeLoading();
connection.onProgressLogged(Group.fromJson(response.data), summary);
} catch (e) {
handleError(e, () => logProgress(request, summary), () => dismissError(),
"Retry");
}
}
void nudge(NudgeRequest request, String who) async {
if (!await hasNetwork(() => nudge(request, who))) return;
try {
await getDataManager().nudgeGroupMember(request);
connection.onNudged(who);
} catch (e) {
handleError(e, () => nudge(request, who), () => dismissError(), "Retry");
}
}
void leave(String groupId) async {
if (!await hasNetwork(() => leave(groupId))) return;
showLoading("Leaving");
try {
await getDataManager().leaveGroupEntry(IdRequest(id: groupId));
closeLoading();
connection.onLeft();
} catch (e) {
handleError(e, () => leave(groupId), () => dismissError(), "Retry");
}
}
}