Skip to content

Offline gym log for Android. No account, no ads, no internet.

Polish across workouts, progress and routines

InlitX399b14fd8c87
diff --git a/lib/screens/ai_plan_screen.dart b/lib/screens/ai_plan_screen.dart
index 47c8b7e..8ad9b85 100644
--- a/lib/screens/ai_plan_screen.dart
+++ b/lib/screens/ai_plan_screen.dart
@@ -50,7 +50,7 @@ class _AiPlanScreenState extends State<AiPlanScreen> {
ScreenHeader(title: t.aiRoutine, onBack: fit.backFromAiPlan, titleSize: 22),
const SizedBox(height: 20),
SoftCard(
- radius: 20,
+ radius: 22,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
diff --git a/lib/screens/history_screen.dart b/lib/screens/history_screen.dart
index 24fe5d9..e211191 100644
--- a/lib/screens/history_screen.dart
+++ b/lib/screens/history_screen.dart
@@ -47,7 +47,7 @@ class HistoryScreen extends StatelessWidget {
_empty(gc)
else ...[
Text(t.historyWorkouts(list.length),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const SizedBox(height: 10),
for (var i = 0; i < list.length; i++) ...[
Rise(index: i + 1, child: WorkoutHistoryCard(session: list[i], records: records[list[i]] ?? 0)),
@@ -238,7 +238,11 @@ class WorkoutHistoryCard extends StatelessWidget {
final start = TimeOfDay.fromDateTime(s.day);
final clock = MaterialLocalizations.of(context)
.formatTimeOfDay(start, alwaysUse24HourFormat: MediaQuery.alwaysUse24HourFormatOf(context));
- final meta = [clock, if (s.durationSec >= 60) '${(s.durationSec / 60).round()} min'].join(' · ');
+ final meta = [
+ clock,
+ if (s.durationSec >= 60) '${(s.durationSec / 60).round()} min',
+ if (s.hrAvg != null) '\u2665 ${s.hrAvg} · ${t.hrMaxShort(s.hrMax ?? s.hrAvg!)}',
+ ].join(' · ');
final shown = s.exercises.take(4).toList();
return Pressable(
scale: 0.98,
diff --git a/lib/screens/ladder_sheet.dart b/lib/screens/ladder_sheet.dart
index 561eb9a..a2e949d 100644
--- a/lib/screens/ladder_sheet.dart
+++ b/lib/screens/ladder_sheet.dart
@@ -73,10 +73,7 @@ class _LadderSheetState extends State<_LadderSheet> {
return Container(
padding: sheetPad(context),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(context).height * 0.9),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -217,10 +214,7 @@ Future<Exercise?> _pickStep(BuildContext context, Exercise base, List<String> ta
return Container(
padding: sheetPad(sheet),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.82),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
diff --git a/lib/screens/note_edit_screen.dart b/lib/screens/note_edit_screen.dart
index 3f76920..4fc033c 100644
--- a/lib/screens/note_edit_screen.dart
+++ b/lib/screens/note_edit_screen.dart
@@ -365,10 +365,7 @@ class _ExercisePickerSheetState extends State<_ExercisePickerSheet> {
child: Container(
height: MediaQuery.of(context).size.height * 0.72,
padding: sheetPad(context, bottom: 16),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
diff --git a/lib/screens/places_screen.dart b/lib/screens/places_screen.dart
index a5bf65c..1e43d46 100644
--- a/lib/screens/places_screen.dart
+++ b/lib/screens/places_screen.dart
@@ -312,11 +312,7 @@ class PlacesScreen extends StatelessWidget {
final bar = current.bar == null ? fit.defaultBar : fit.toDisplayWeight(current.bar!);
return Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
diff --git a/lib/screens/progress_screen.dart b/lib/screens/progress_screen.dart
index 6634b9f..4cefa6c 100644
--- a/lib/screens/progress_screen.dart
+++ b/lib/screens/progress_screen.dart
@@ -13,6 +13,7 @@ import '../state/fit_state.dart';
import '../theme/app_colors.dart';
import '../theme/app_theme.dart';
import '../widgets/body_map.dart';
+import '../widgets/check_in.dart';
import '../widgets/charts.dart';
import '../widgets/dialogs.dart';
import '../widgets/entrance.dart';
@@ -21,6 +22,7 @@ import '../widgets/file_thumb.dart';
import '../widgets/glass.dart';
import '../widgets/health_cards.dart';
import '../widgets/liquid_notch.dart';
+import '../widgets/report_sheet.dart';
import '../widgets/muscle_radar.dart';
import '../widgets/nutrition_art.dart' show ValueLineChart;
import '../widgets/rolling_text.dart';
@@ -121,6 +123,10 @@ class ProgressScreen extends StatelessWidget {
Icon(PhosphorIconsBold.clockCounterClockwise, size: 16, color: gc.textSecondary),
], const EdgeInsets.fromLTRB(14, 0, 12, 0)),
Container(width: 1, height: 18, color: gc.border),
+ half(t.reportTitle, () => showReportSheet(context), [
+ Icon(PhosphorIconsBold.fileText, size: 16, color: gc.textSecondary),
+ ], const EdgeInsets.fromLTRB(12, 0, 12, 0)),
+ Container(width: 1, height: 18, color: gc.border),
],
half(t.share, () => showShareSheet(context), [
Icon(PhosphorIconsBold.export, size: 15, color: gc.accent),
@@ -153,7 +159,7 @@ class ProgressScreen extends StatelessWidget {
Row(children: [
Expanded(
child: FitText(label.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
),
?badge,
]),
@@ -263,7 +269,7 @@ class ProgressScreen extends StatelessWidget {
Row(
children: [
Text(t.consistency.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const Spacer(),
GestureDetector(
behavior: HitTestBehavior.opaque,
@@ -319,6 +325,7 @@ class ProgressScreen extends StatelessWidget {
Widget _totals(GymColors gc) {
final hours = fit.totalTime.inHours;
+ final lifted = fit.liftedSpanOf(fit.totalVolumeKg);
final cells = <(String, String, String)>[
(t.allTimeSessions, '${fit.totalSessions}', ''),
(t.allTimeSets, '${fit.totalSets}', ''),
@@ -327,18 +334,20 @@ class ProgressScreen extends StatelessWidget {
hours >= 1 ? '$hours' : '${fit.totalTime.inMinutes}',
hours >= 1 ? t.unitHours : 'min'
),
+ (t.allTimeLifted, lifted.$1, lifted.$2),
];
- return IntrinsicHeight(
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- for (var i = 0; i < cells.length; i++) ...[
- Expanded(child: _tile(gc, label: cells[i].$1, value: cells[i].$2, unit: cells[i].$3)),
- if (i < cells.length - 1) const SizedBox(width: 12),
- ],
- ],
- ),
- );
+ Widget row(int from) => IntrinsicHeight(
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ for (var i = from; i < from + 2; i++) ...[
+ Expanded(child: _tile(gc, label: cells[i].$1, value: cells[i].$2, unit: cells[i].$3)),
+ if (i == from) const SizedBox(width: 12),
+ ],
+ ],
+ ),
+ );
+ return Column(children: [row(0), const SizedBox(height: 12), row(2)]);
}
Widget _thisWeek(GymColors gc) {
@@ -360,7 +369,7 @@ class ProgressScreen extends StatelessWidget {
children: [
Row(children: [
Text(t.thisWeekTitle.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const Spacer(),
Text(t.setsThisWeek(sets.fold(0, (a, b) => a + b)),
style: AppTheme.f(11.5, weight: FontWeight.w600, color: gc.textSecondary)),
@@ -498,6 +507,8 @@ class ProgressScreen extends StatelessWidget {
return [
if (fit.sessions.isNotEmpty) _thisWeek(gc),
if (fit.trackedExercises.isNotEmpty) _StrengthCard(),
+ if (fit.structuralBalance != null) const _BalanceCard(),
+ if (fit.readinessRecent.rated > 0) _ReadinessCard(),
if (prs.isNotEmpty) _PrCard(prs),
if (fit.shotCount > 0) _timelineCard(gc),
if (fit.measures.isNotEmpty) _measuresCard(gc),
@@ -764,7 +775,7 @@ class ProgressScreen extends StatelessWidget {
children: [
Expanded(
child: Text(t.measures.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
),
Icon(PhosphorIconsRegular.caretRight, size: 15, color: gc.textTertiary),
],
@@ -797,7 +808,9 @@ class ProgressScreen extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(t.measureName(key),
+ Text(fit.measureTitle(key),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
style: AppTheme.s(10.5, weight: FontWeight.w600, color: gc.textTertiary)),
const SizedBox(height: 3),
Text(fit.measureLabel(key, latest.value),
@@ -853,6 +866,155 @@ class _BodyweightSheetState extends State<_BodyweightSheet> {
String _signed(double kg) => '${kg > 0 ? '+' : kg < 0 ? '−' : ''}${fit.weightLabel(kg.abs())}';
+ String _pct(double v) => '${v > 0 ? '+' : v < 0 ? '−' : ''}${decimalText(v.abs().toStringAsFixed(2))} %';
+
+ Future<void> _pickAim() async {
+ final gc = context.gc;
+ await showAppSheet<void>(
+ context: context,
+ backgroundColor: Colors.transparent,
+ builder: (sheet) => Container(
+ padding: sheetPad(sheet),
+ decoration: sheetDecoration(gc),
+ child: Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ const SheetHandle(),
+ const SizedBox(height: 16),
+ SheetTitle(t.paceAimTitle, subtitle: t.paceAimHint),
+ const SizedBox(height: 14),
+ OptionGroup([
+ for (final (aim, label, detail) in [
+ ('lose', t.paceLose, t.paceLoseRange),
+ ('hold', t.paceHold, t.paceHoldRange),
+ ('gain', t.paceGain, t.paceGainRange),
+ ('', t.paceAuto, t.paceAutoHint),
+ ])
+ OptionItem(label,
+ detail: detail,
+ selected: fit.weightAim == aim,
+ onTap: () {
+ fit.setWeightAim(aim);
+ Navigator.pop(sheet);
+ }),
+ ]),
+ ]),
+ ),
+ );
+ }
+
+ Widget _paceCard(GymColors gc) {
+ final pace = fit.weightPace!;
+ final status = fit.weightPaceStatus;
+ final aim = fit.effectiveWeightAim;
+ final band = NutritionState.paceCorridors[aim];
+ final (text, color) = switch (status) {
+ 'onPace' => (t.paceOn, gc.sage),
+ 'tooFast' => (t.paceTooFast, gc.warn),
+ 'tooSlow' => (t.paceTooSlow, gc.brass),
+ 'wrongWay' => (t.paceWrongWay, gc.danger),
+ 'drifting' => (t.paceDrifting, gc.warn),
+ _ => (t.paceSetAim, gc.textSecondary),
+ };
+ const span = 1.5;
+ double at(double v) => ((v + span) / (span * 2)).clamp(0.0, 1.0);
+ return Pressable(
+ scale: 0.98,
+ onTap: _pickAim,
+ child: SoftCard(
+ radius: 22,
+ padding: const EdgeInsets.fromLTRB(16, 16, 16, 14),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
+ Text('${_signed(pace.kgPerWeek)}/${t.weekShort}',
+ style: AppTheme.f(22, weight: FontWeight.w800, color: gc.text)),
+ const SizedBox(width: 8),
+ Padding(
+ padding: const EdgeInsets.only(bottom: 3),
+ child: Text(_pct(pace.pctPerWeek),
+ style: AppTheme.f(12.5, weight: FontWeight.w700, color: gc.textSecondary)),
+ ),
+ const Spacer(),
+ Icon(PhosphorIconsRegular.slidersHorizontal, size: 16, color: gc.textTertiary),
+ ]),
+ const SizedBox(height: 14),
+ LayoutBuilder(builder: (context, box) {
+ final w = box.maxWidth;
+ return SizedBox(
+ height: 16,
+ child: Stack(clipBehavior: Clip.none, children: [
+ Positioned(
+ left: 0,
+ right: 0,
+ top: 5,
+ height: 6,
+ child: DecoratedBox(
+ decoration: BoxDecoration(color: gc.bgRaised2, borderRadius: BorderRadius.circular(3))),
+ ),
+ if (band != null)
+ Positioned(
+ left: w * at(band.$1),
+ width: w * (at(band.$2) - at(band.$1)),
+ top: 5,
+ height: 6,
+ child: DecoratedBox(
+ decoration: BoxDecoration(
+ color: gc.sage.withValues(alpha: 0.45), borderRadius: BorderRadius.circular(3)),
+ ),
+ ),
+ Positioned(
+ left: w / 2 - 0.75,
+ top: 2,
+ width: 1.5,
+ height: 12,
+ child: ColoredBox(color: gc.textTertiary.withValues(alpha: 0.5)),
+ ),
+ TweenAnimationBuilder<double>(
+ tween: Tween(end: at(pace.pctPerWeek)),
+ duration: const Duration(milliseconds: 520),
+ curve: Curves.easeOutCubic,
+ builder: (_, v, _) => Positioned(
+ left: (w * v - 8).clamp(0.0, w - 16),
+ top: 0,
+ child: Container(
+ width: 16,
+ height: 16,
+ decoration: BoxDecoration(
+ color: color,
+ shape: BoxShape.circle,
+ border: Border.all(color: gc.bgRaised, width: 3),
+ ),
+ ),
+ ),
+ ),
+ ]),
+ );
+ }),
+ const SizedBox(height: 12),
+ Row(children: [
+ Container(
+ width: 8,
+ height: 8,
+ decoration: BoxDecoration(color: color, shape: BoxShape.circle),
+ ),
+ const SizedBox(width: 8),
+ Expanded(
+ child: Text(text, style: AppTheme.f(13, weight: FontWeight.w700, color: gc.text)),
+ ),
+ Text(
+ switch (aim) {
+ 'lose' => t.paceLose,
+ 'gain' => t.paceGain,
+ 'hold' => t.paceHold,
+ _ => '',
+ },
+ style: AppTheme.f(12, weight: FontWeight.w600, color: gc.textTertiary)),
+ ]),
+ const SizedBox(height: 4),
+ Text(t.paceBasis, style: AppTheme.s(11.5, color: gc.textTertiary)),
+ ]),
+ ),
+ );
+ }
+
List<(DateTime, double)> _weeks(List<BodyweightEntry> all) {
final sums = <DateTime, (double, int)>{};
for (final e in all) {
@@ -868,7 +1030,7 @@ class _BodyweightSheetState extends State<_BodyweightSheet> {
Widget _kicker(GymColors gc, String text) => Padding(
padding: const EdgeInsets.only(left: 4, top: 22, bottom: 10),
child: Text(text.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.1)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
);
@override
@@ -891,11 +1053,7 @@ class _BodyweightSheetState extends State<_BodyweightSheet> {
final recentWeeks = weeks.length > 8 ? weeks.sublist(weeks.length - 8) : weeks;
return Container(
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(context).height * 0.9),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SingleChildScrollView(
padding: EdgeInsets.fromLTRB(20, 12, 20, 20 + MediaQuery.paddingOf(context).bottom),
child: Column(
@@ -977,6 +1135,10 @@ class _BodyweightSheetState extends State<_BodyweightSheet> {
style: AppTheme.f(12.5, weight: FontWeight.w700, color: diff.abs() < 0.05 ? gc.sage : gc.textSecondary),
),
],
+ if (fit.weightPace != null) ...[
+ _kicker(gc, t.paceTitle),
+ _paceCard(gc),
+ ],
if (recentWeeks.length >= 2) ...[
_kicker(gc, t.weeklyAvgTitle),
SoftCard(
@@ -994,7 +1156,7 @@ class _BodyweightSheetState extends State<_BodyweightSheet> {
),
const SizedBox(height: 10),
SoftCard(
- radius: 20,
+ radius: 22,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
child: Column(children: [
for (var i = recentWeeks.length - 1; i >= 0; i--)
@@ -1025,7 +1187,7 @@ class _BodyweightSheetState extends State<_BodyweightSheet> {
if (all.isNotEmpty) ...[
_kicker(gc, t.bodyweightHistory),
SoftCard(
- radius: 20,
+ radius: 22,
padding: const EdgeInsets.only(left: 16),
child: Column(children: [
for (final e in all.reversed.take(30))
@@ -1236,7 +1398,7 @@ class _MuscleMapCardState extends State<_MuscleMapCard> {
Text(t.muscleMap,
maxLines: 1,
overflow: TextOverflow.ellipsis,
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const SizedBox(height: 10),
Align(
alignment: AlignmentDirectional.centerStart,
@@ -1400,12 +1562,17 @@ class _MuscleMapCardState extends State<_MuscleMapCard> {
Text(t.recoveryFresh, style: AppTheme.s(11, color: gc.textTertiary)),
]),
const SizedBox(height: 14),
- Container(
- constraints: const BoxConstraints(minHeight: 36),
- alignment: Alignment.centerLeft,
- child: focus == null
- ? Text(t.recoveryHint, style: AppTheme.s(13, color: gc.textSecondary))
- : _recoveryReadout(gc, focus, recovery[focus] ?? 1),
+ AnimatedSize(
+ duration: const Duration(milliseconds: 260),
+ curve: Curves.easeOutCubic,
+ alignment: Alignment.topCenter,
+ child: Container(
+ constraints: const BoxConstraints(minHeight: 36),
+ alignment: Alignment.centerLeft,
+ child: focus == null
+ ? Text(t.recoveryHint, style: AppTheme.s(13, color: gc.textSecondary))
+ : _recoveryReadout(gc, focus, recovery[focus] ?? 1),
+ ),
),
],
),
@@ -1413,22 +1580,73 @@ class _MuscleMapCardState extends State<_MuscleMapCard> {
}
Widget _recoveryReadout(GymColors gc, String id, double value) {
- final hours = fit.hoursUntilRecovered(id);
- return Row(children: [
- Container(
- width: 10,
- height: 10,
- decoration: BoxDecoration(color: recoveryColor(gc, value), shape: BoxShape.circle),
- ),
- const SizedBox(width: 8),
- Text(t.muscle(id), style: AppTheme.s(13, weight: FontWeight.w600, color: gc.text)),
- const SizedBox(width: 8),
- Expanded(
- child: Text(
- hours == null
- ? t.recoveryPct((value * 100).round())
- : '${t.recoveryPct((value * 100).round())} · ${t.readyInHours(hours)}',
- style: AppTheme.s(13, color: gc.textSecondary)),
+ final toMid = value < 0.5 ? fit.hoursUntilRecovery(id, 0.5) : null;
+ final toReady = value < 0.8 ? fit.hoursUntilRecovery(id, 0.8) : null;
+ final (label, color) = value < 0.5
+ ? (t.recoveryTired, gc.danger)
+ : value < 0.8
+ ? (t.recoveryStateMid, gc.warn)
+ : (t.recoveryStateReady, gc.sage);
+ String when(int h) => h < 48 ? '$h h' : '${(h / 24).round()} ${t.unitDays}';
+ return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ Row(children: [
+ Text(t.muscle(id), style: AppTheme.f(15, weight: FontWeight.w700, color: gc.text)),
+ const SizedBox(width: 8),
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 3),
+ decoration: BoxDecoration(color: color.withValues(alpha: 0.14), borderRadius: BorderRadius.circular(100)),
+ child: Text(label, style: AppTheme.f(11, weight: FontWeight.w700, color: color)),
+ ),
+ const Spacer(),
+ Text('${(value * 100).round()}%', style: AppTheme.d(20, weight: FontWeight.w800, color: gc.text)),
+ ]),
+ const SizedBox(height: 10),
+ LayoutBuilder(builder: (context, box) {
+ final w = box.maxWidth;
+ Widget zone(double from, double to, Color c) => Positioned(
+ left: w * from + (from > 0 ? 2 : 0),
+ width: w * (to - from) - (from > 0 ? 2 : 0),
+ top: 3,
+ height: 8,
+ child: DecoratedBox(
+ decoration: BoxDecoration(color: c.withValues(alpha: 0.28), borderRadius: BorderRadius.circular(4)),
+ ),
+ );
+ return SizedBox(
+ height: 14,
+ child: Stack(clipBehavior: Clip.none, children: [
+ zone(0, 0.5, gc.danger),
+ zone(0.5, 0.8, gc.warn),
+ zone(0.8, 1, gc.sage),
+ TweenAnimationBuilder<double>(
+ tween: Tween(end: value.clamp(0.0, 1.0)),
+ duration: const Duration(milliseconds: 420),
+ curve: Curves.easeOutCubic,
+ builder: (_, v, _) => Positioned(
+ left: (w * v - 7).clamp(0.0, w - 14),
+ top: 0,
+ child: Container(
+ width: 14,
+ height: 14,
+ decoration: BoxDecoration(
+ color: recoveryColor(gc, v),
+ shape: BoxShape.circle,
+ border: Border.all(color: gc.bgRaised, width: 2.5),
+ ),
+ ),
+ ),
+ ),
+ ]),
+ );
+ }),
+ const SizedBox(height: 10),
+ Text(
+ [
+ if (toMid != null) t.recoveringIn(when(toMid)),
+ if (toReady != null) t.readyIn(when(toReady)),
+ if (toReady == null) t.recoveryReadyNow,
+ ].join(' · '),
+ style: AppTheme.s(12.5, color: gc.textSecondary),
),
]);
}
@@ -1466,7 +1684,7 @@ class _StrengthCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(t.strength1rm,
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const SizedBox(height: 14),
if (id == null)
Text(t.strengthEmpty, style: AppTheme.s(13, color: gc.textSecondary))
@@ -1633,10 +1851,7 @@ class _StrengthCard extends StatelessWidget {
return Container(
padding: sheetPad(sheet),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.8),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1725,7 +1940,7 @@ class _PrCardState extends State<_PrCard> {
const SizedBox(width: 7),
Expanded(
child: Text(t.personalRecords,
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
),
Text('${prs.length}', style: AppTheme.f(12, weight: FontWeight.w700, color: gc.textSecondary)),
]),
@@ -1841,11 +2056,7 @@ class _DaySheet extends StatelessWidget {
final gc = context.gc;
final s = fit.daySummary(date);
return Container(
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
clipBehavior: Clip.antiAlias,
child: SingleChildScrollView(
padding: sheetPad(context),
@@ -1917,18 +2128,26 @@ class _DaySheet extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.only(bottom: 6),
child: Row(children: [
- Flexible(
- child: Text(
- title ?? t.nameWorkout,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: title == null
- ? AppTheme.f(13, weight: FontWeight.w600, color: gc.textTertiary)
- : AppTheme.f(16, weight: FontWeight.w700, color: gc.text),
- ),
+ Expanded(
+ child: Row(children: [
+ Flexible(
+ child: Text(
+ title ?? t.nameWorkout,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: title == null
+ ? AppTheme.f(13, weight: FontWeight.w600, color: gc.textTertiary)
+ : AppTheme.f(16, weight: FontWeight.w700, color: gc.text),
+ ),
+ ),
+ const SizedBox(width: 6),
+ Icon(PhosphorIconsRegular.pencilSimple, size: 13, color: gc.textTertiary),
+ ]),
),
- const SizedBox(width: 6),
- Icon(PhosphorIconsRegular.pencilSimple, size: 13, color: gc.textTertiary),
+ if (fit.askCheckIn || s.sleep != null || s.energy != null) ...[
+ const SizedBox(width: 8),
+ _checkInPill(context, gc, s),
+ ],
]),
),
),
@@ -1943,6 +2162,52 @@ class _DaySheet extends StatelessWidget {
);
}
+ void _showCheckIn(BuildContext context, LoggedSession s) => showAppSheet<void>(
+ context: context,
+ backgroundColor: Colors.transparent,
+ builder: (sheetCtx) {
+ final gc = sheetCtx.gc;
+ return Container(
+ decoration: sheetDecoration(gc),
+ padding: sheetPad(sheetCtx),
+ child: AnimatedBuilder(
+ animation: fit,
+ builder: (_, _) => Column(mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ const SheetHandle(),
+ const SizedBox(height: 18),
+ CheckInCard(s, flat: true),
+ const SizedBox(height: 8),
+ ]),
+ ),
+ );
+ },
+ );
+
+ Widget _checkInPill(BuildContext context, GymColors gc, LoggedSession s) {
+ Widget part(IconData icon, int? v, Color color) => Row(mainAxisSize: MainAxisSize.min, children: [
+ Icon(icon, size: 12, color: v == null ? gc.textTertiary : color),
+ const SizedBox(width: 4),
+ Text(v == null ? '–' : '$v', style: AppTheme.s(11, weight: FontWeight.w700, color: gc.textSecondary)),
+ ]);
+ return Semantics(
+ button: true,
+ label: t.checkInTitle,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () => _showCheckIn(context, s),
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
+ decoration: BoxDecoration(color: gc.bgRaised2, borderRadius: BorderRadius.circular(100)),
+ child: Row(mainAxisSize: MainAxisSize.min, children: [
+ part(PhosphorIconsRegular.moon, s.sleep, gc.sage),
+ const SizedBox(width: 8),
+ part(PhosphorIconsRegular.lightning, s.energy, gc.brass),
+ ]),
+ ),
+ ),
+ );
+ }
+
Future<void> _renameSession(BuildContext context, LoggedSession s) async {
final current = fit.sessionTitle(s) ?? '';
final name = await askText(context, title: t.sessionName, initial: current, hint: t.sessionNameHint);
@@ -2122,6 +2387,21 @@ class _DaySheet extends StatelessWidget {
Text('${kcal.own ? '' : '≈ '}${fit.energyOf(kcal.active)} ${fit.energyUnit} ${t.kcalActive}',
style: AppTheme.s(11, weight: FontWeight.w600, color: gc.warn)),
],
+ for (var i = 0; i < e.sets.length; i++)
+ if (e.sets[i].note.isNotEmpty) ...[
+ const SizedBox(height: 3),
+ Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Padding(
+ padding: const EdgeInsets.only(top: 1),
+ child: Icon(PhosphorIconsFill.notePencil, size: 11, color: gc.textTertiary),
+ ),
+ const SizedBox(width: 5),
+ Expanded(
+ child: Text(t.setNoteLine(i + 1, e.sets[i].note),
+ style: AppTheme.s(11, color: gc.textSecondary, height: 1.3)),
+ ),
+ ]),
+ ],
],
),
),
@@ -2171,7 +2451,7 @@ class _DaySheet extends StatelessWidget {
Widget fit1(Widget child) =>
FittedBox(fit: BoxFit.scaleDown, alignment: Alignment.centerLeft, child: child);
return SoftCard(
- radius: 14,
+ radius: 16,
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -2211,11 +2491,7 @@ class _LogBodyweightSheetState extends State<_LogBodyweightSheet> {
final gc = context.gc;
return Container(
padding: EdgeInsets.fromLTRB(20, 12, 20, 20 + MediaQuery.of(context).viewInsets.bottom + MediaQuery.paddingOf(context).bottom),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -2307,11 +2583,7 @@ void showEditLoggedSheet(BuildContext context, LoggedSession s, LoggedExercise e
final repsOnly = fit.isRepsOnly(e.id);
return Container(
padding: EdgeInsets.only(bottom: MediaQuery.of(sheetCtx).viewInsets.bottom),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SafeArea(
child: SingleChildScrollView(
padding: const EdgeInsets.fromLTRB(20, 12, 20, 24),
@@ -2536,11 +2808,7 @@ class _HeatToneSheetState extends State<_HeatToneSheet> {
final gc = context.gc;
return Container(
padding: sheetPad(context),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -2640,3 +2908,207 @@ class _TrackPainter extends CustomPainter {
bool shouldRepaint(_TrackPainter o) =>
o.spots != spots || o.color != color || o.rail != rail || o.open != open;
}
+
+class _BalanceCard extends StatefulWidget {
+ const _BalanceCard();
+
+ @override
+ State<_BalanceCard> createState() => _BalanceCardState();
+}
+
+class _ReadinessCard extends StatelessWidget {
+ const _ReadinessCard();
+
+ @override
+ Widget build(BuildContext context) {
+ final gc = context.gc;
+ final effect = fit.readinessEffect;
+ final recent = fit.readinessRecent;
+ final String headline;
+ if (effect == null) {
+ headline = t.readinessWaiting;
+ } else if (effect.pct.abs() < 3) {
+ headline = effect.sleep ? t.readinessSleepNone : t.readinessEnergyNone;
+ } else if (effect.pct < 0) {
+ headline = effect.sleep ? t.readinessSleepLess(-effect.pct) : t.readinessEnergyLess(-effect.pct);
+ } else {
+ headline = effect.sleep ? t.readinessSleepMore(effect.pct) : t.readinessEnergyMore(effect.pct);
+ }
+ Widget avg(IconData icon, String label, double? v, Color color) => Expanded(
+ child: Container(
+ padding: const EdgeInsets.fromLTRB(12, 10, 12, 10),
+ decoration: BoxDecoration(color: gc.bgRaised2, borderRadius: BorderRadius.circular(14)),
+ child: Row(children: [
+ Icon(icon, size: 15, color: v == null ? gc.textTertiary : color),
+ const SizedBox(width: 8),
+ Expanded(
+ child: Text(label,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(12, weight: FontWeight.w600, color: gc.textSecondary)),
+ ),
+ Text(v == null ? '–' : checkInWord(v.round()),
+ style: AppTheme.f(12.5, weight: FontWeight.w700, color: v == null ? gc.textTertiary : gc.text)),
+ ]),
+ ),
+ );
+ return SoftCard(
+ radius: 22,
+ borderColor: Colors.transparent,
+ padding: const EdgeInsets.fromLTRB(18, 18, 18, 16),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ Text(t.readinessTitle.toUpperCase(),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
+ const SizedBox(height: 8),
+ Text(headline, style: AppTheme.f(15, weight: FontWeight.w700, color: gc.text, height: 1.3)),
+ const SizedBox(height: 4),
+ Text(effect == null ? t.readinessWaitingHint : t.readinessHint,
+ style: AppTheme.s(12.5, color: gc.textSecondary, height: 1.4)),
+ const SizedBox(height: 14),
+ Text(t.readinessLast30, style: AppTheme.s(11, weight: FontWeight.w600, color: gc.textTertiary)),
+ const SizedBox(height: 8),
+ Row(children: [
+ avg(PhosphorIconsRegular.moon, t.checkInSleep, recent.sleep, gc.sage),
+ const SizedBox(width: 8),
+ avg(PhosphorIconsRegular.lightning, t.checkInEnergy, recent.energy, gc.brass),
+ ]),
+ ]),
+ );
+ }
+}
+
+class _BalanceCardState extends State<_BalanceCard> {
+ bool _why = false;
+
+ String _name(String id) {
+ final ex = fit.exerciseById(id);
+ return ex == null ? id : t.catalogName(ex.id, ex.name);
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final gc = context.gc;
+ final data = fit.structuralBalance;
+ if (data == null) return const SizedBox.shrink();
+ final behind = data.behind;
+ return SoftCard(
+ radius: 22,
+ borderColor: Colors.transparent,
+ padding: const EdgeInsets.fromLTRB(18, 18, 18, 14),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ Row(children: [
+ Expanded(
+ child: Text(t.balanceTitle.toUpperCase(),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
+ ),
+ Semantics(
+ button: true,
+ label: t.balanceWhy,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () => setState(() => _why = !_why),
+ child: Padding(
+ padding: const EdgeInsets.all(4),
+ child: Icon(_why ? PhosphorIconsFill.info : PhosphorIconsRegular.info, size: 17, color: gc.textSecondary),
+ ),
+ ),
+ ),
+ ]),
+ const SizedBox(height: 8),
+ Text(
+ behind == null
+ ? t.balanceGood
+ : t.balanceBehind(_name(behind),
+ fit.weightLabel(data.lifts.firstWhere((l) => l.id == behind).target - data.lifts.firstWhere((l) => l.id == behind).kg)),
+ style: AppTheme.f(15, weight: FontWeight.w700, color: gc.text, height: 1.3),
+ ),
+ AnimatedSize(
+ duration: const Duration(milliseconds: 260),
+ curve: Curves.easeOutCubic,
+ alignment: Alignment.topCenter,
+ child: _why
+ ? Padding(
+ padding: const EdgeInsets.only(top: 6),
+ child: Text(t.balanceHint, style: AppTheme.s(12.5, color: gc.textSecondary, height: 1.4)),
+ )
+ : const SizedBox(width: double.infinity),
+ ),
+ const SizedBox(height: 14),
+ for (final l in data.lifts) _row(gc, l, l.id == behind),
+ const SizedBox(height: 4),
+ Row(children: [
+ Text(t.balanceBehindShort, style: AppTheme.s(11, color: gc.textTertiary)),
+ const Spacer(),
+ Text(t.balanceAheadShort, style: AppTheme.s(11, color: gc.textTertiary)),
+ ]),
+ ]),
+ );
+ }
+
+ Widget _row(GymColors gc, ({String id, double kg, double target, double score}) l, bool behind) {
+ final gap = l.target - l.kg;
+ final even = l.score >= 0.95 && l.score <= 1.05;
+ final color = behind ? gc.warn : (l.score < 0.95 ? Color.lerp(gc.textSecondary, gc.warn, 0.4)! : gc.sage);
+ return Padding(
+ padding: const EdgeInsets.only(bottom: 12),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ Row(children: [
+ Expanded(
+ child: Text(_name(l.id),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(13, weight: FontWeight.w600, color: gc.text)),
+ ),
+ const SizedBox(width: 8),
+ Text(
+ even
+ ? t.balanceEven
+ : gap > 0
+ ? '−${fit.weightLabel(gap)}'
+ : '+${fit.weightLabel(-gap)}',
+ style: AppTheme.f(12, weight: FontWeight.w700, color: even ? gc.textSecondary : color)),
+ ]),
+ const SizedBox(height: 6),
+ LayoutBuilder(builder: (context, box) {
+ final w = box.maxWidth;
+ final pos = ((l.score - 0.6) / 0.8).clamp(0.0, 1.0);
+ return SizedBox(
+ height: 12,
+ child: Stack(clipBehavior: Clip.none, children: [
+ Positioned(
+ left: 0,
+ right: 0,
+ top: 4,
+ height: 4,
+ child: DecoratedBox(
+ decoration: BoxDecoration(color: gc.bgRaised2, borderRadius: BorderRadius.circular(2))),
+ ),
+ Positioned(
+ left: w / 2 - 1,
+ top: 0,
+ width: 2,
+ height: 12,
+ child: ColoredBox(color: gc.textTertiary.withValues(alpha: 0.6)),
+ ),
+ TweenAnimationBuilder<double>(
+ tween: Tween(end: pos),
+ duration: const Duration(milliseconds: 520),
+ curve: Curves.easeOutCubic,
+ builder: (_, v, _) {
+ final x = w * v, mid = w / 2;
+ return Positioned(
+ left: x < mid ? x : mid,
+ width: (x - mid).abs(),
+ top: 4,
+ height: 4,
+ child: DecoratedBox(decoration: BoxDecoration(color: color, borderRadius: BorderRadius.circular(2))),
+ );
+ },
+ ),
+ ]),
+ );
+ }),
+ ]),
+ );
+ }
+}
diff --git a/lib/screens/routine_edit_screen.dart b/lib/screens/routine_edit_screen.dart
index b01262c..2982e2e 100644
--- a/lib/screens/routine_edit_screen.dart
+++ b/lib/screens/routine_edit_screen.dart
@@ -506,10 +506,7 @@ class _RoutineEditScreenState extends State<RoutineEditScreen> {
final gc = sheet.gc;
return Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -826,10 +823,7 @@ class _RoutineEditScreenState extends State<RoutineEditScreen> {
return Container(
padding: sheetPad(sheet),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.9),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -999,7 +993,7 @@ class _RoutineEditScreenState extends State<RoutineEditScreen> {
'time' => [t.timeCol, if (!repsOnly) t.weightCol(fit.units.toUpperCase())],
_ => [t.repsCol, if (!repsOnly) t.weightCol(fit.units.toUpperCase())],
};
- final style = AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1);
+ final style = AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4);
return Row(children: [
SizedBox(width: 40, child: Center(child: Text(t.setCol, style: style))),
const SizedBox(width: 8),
@@ -1162,10 +1156,7 @@ class _RoutineEditScreenState extends State<RoutineEditScreen> {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1248,7 +1239,7 @@ class _RoutineEditScreenState extends State<RoutineEditScreen> {
showAppSheet<void>(
context: context,
backgroundColor: gc.bgRaised,
- shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(24))),
+ shape: sheetShape(gc),
builder: (_) => SafeArea(
child: Padding(
padding: const EdgeInsets.fromLTRB(20, 20, 20, 20),
diff --git a/lib/screens/routines_screen.dart b/lib/screens/routines_screen.dart
index e0c213d..7a7c529 100644
--- a/lib/screens/routines_screen.dart
+++ b/lib/screens/routines_screen.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import '../widgets/body_map.dart';
import 'package:flutter/services.dart';
import 'package:phosphoricons_flutter/phosphoricons_flutter.dart';
@@ -16,6 +17,7 @@ import '../widgets/liquid_notch.dart';
import '../widgets/routine_folder.dart';
import '../widgets/svg_icon.dart';
import '../widgets/ui_kit.dart';
+import 'circuit_screen.dart';
import 'plan_import_sheet.dart';
class RoutinesScreen extends StatelessWidget {
@@ -195,6 +197,8 @@ class RoutinesScreen extends StatelessWidget {
icon: PhosphorIconsRegular.sparkle,
onTap: fit.goAiPlan,
),
+ const SizedBox(height: 30),
+ const CircuitSection(),
]),
),
),
@@ -215,10 +219,7 @@ class RoutinesScreen extends StatelessWidget {
builder: (sheet) => Container(
padding: sheetPad(sheet),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.85),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -242,7 +243,7 @@ class RoutinesScreen extends StatelessWidget {
}),
const SizedBox(height: 14),
Text(t.shareRoutine.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const SizedBox(height: 8),
for (final r in [
for (final group in fit.routineGroups) ...fit.routinesInGroup(group),
@@ -316,10 +317,7 @@ class RoutinesScreen extends StatelessWidget {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -349,10 +347,7 @@ class RoutinesScreen extends StatelessWidget {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -428,10 +423,7 @@ class RoutinesScreen extends StatelessWidget {
builder: (sheet) => Container(
padding: sheetPad(sheet),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.85),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -505,7 +497,7 @@ class RoutinesScreen extends StatelessWidget {
final step = fit.rotationStep;
final routines = fit.rotationRoutines;
return SoftCard(
- radius: 20,
+ radius: 22,
borderColor: Colors.transparent,
padding: const EdgeInsets.fromLTRB(6, 14, 6, 8),
child: Column(
@@ -688,10 +680,7 @@ class RoutinesScreen extends StatelessWidget {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -798,6 +787,10 @@ class RoutinesScreen extends StatelessWidget {
],
),
),
+ if (r.exerciseIds.isNotEmpty && fit.showMiniBody) ...[
+ const SizedBox(width: 8),
+ MiniBody(sets: fit.routineMuscleSets(r), height: 38),
+ ],
]),
),
),
@@ -824,10 +817,7 @@ class RoutinesScreen extends StatelessWidget {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -881,10 +871,7 @@ class RoutinesScreen extends StatelessWidget {
builder: (sheet, _) => Container(
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.72),
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1027,10 +1014,7 @@ class RoutinesScreen extends StatelessWidget {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1100,10 +1084,7 @@ class RoutinesScreen extends StatelessWidget {
builder: (sheet, _) => Container(
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.72),
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1172,10 +1153,7 @@ void showTodayPlanMenu(BuildContext context, Routine r) {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1222,10 +1200,7 @@ void showMoveDaySheet(BuildContext context, Routine r) {
builder: (sheet) => Container(
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.8),
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -1278,10 +1253,7 @@ void showRoutineMenu(BuildContext context, Routine r) {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
diff --git a/lib/screens/session_photos.dart b/lib/screens/session_photos.dart
index ba5e1c1..8e79b91 100644
--- a/lib/screens/session_photos.dart
+++ b/lib/screens/session_photos.dart
@@ -52,7 +52,7 @@ class _SessionPhotosState extends State<SessionPhotos> {
const SizedBox(width: 7),
Expanded(
child: Text(t.sessionPhotos.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.2)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
),
if (photos.isNotEmpty)
Text('${photos.length}', style: AppTheme.f(12, weight: FontWeight.w700, color: gc.textSecondary)),
diff --git a/lib/screens/session_screen.dart b/lib/screens/session_screen.dart
index 8ad0076..64ab999 100644
--- a/lib/screens/session_screen.dart
+++ b/lib/screens/session_screen.dart
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
+import '../widgets/body_map.dart';
import 'package:flutter/services.dart';
import 'package:phosphoricons_flutter/phosphoricons_flutter.dart';
@@ -10,8 +11,10 @@ import '../state/fit_state.dart';
import '../theme/app_colors.dart';
import '../theme/app_theme.dart';
import '../widgets/celebration.dart';
+import '../widgets/check_in.dart';
import '../widgets/dialogs.dart';
import '../widgets/entrance.dart';
+import '../widgets/exercise_history_sheet.dart';
import '../widgets/exercise_media.dart';
import '../widgets/exercise_preview.dart';
import '../widgets/glass.dart';
@@ -285,7 +288,7 @@ class SessionScreen extends StatelessWidget {
),
),
const SizedBox(height: 12),
- _guard(locked, PrimaryButton(label: t.finishSession, onTap: fit.finishSession, height: 54)),
+ _guard(locked, PrimaryButton(label: t.finishSession, onTap: fit.finishSession, height: 52)),
],
);
}
@@ -394,6 +397,11 @@ class SessionScreen extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(8, 10, 8, 0),
child: _guard(locked, WorkoutNoteStrip(exerciseId: ex.id, onDark: true)),
),
+ if (!locked && fit.lastSetNotes(ex.id).isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.fromLTRB(8, 8, 8, 0),
+ child: LastSetNotes(exerciseId: ex.id),
+ ),
const SizedBox(height: 12),
Padding(
padding: const EdgeInsets.fromLTRB(8, 0, 8, 6),
@@ -447,10 +455,7 @@ class SessionScreen extends StatelessWidget {
builder: (sheet) => Container(
padding: sheetPad(sheet),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.85),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -837,6 +842,10 @@ class SessionScreen extends StatelessWidget {
const SizedBox(height: 12),
WorkoutNoteStrip(exerciseId: ex.id, onDark: true),
],
+ if (ex != null && fit.lastSetNotes(ex.id).isNotEmpty) ...[
+ const SizedBox(height: 8),
+ LastSetNotes(exerciseId: ex.id),
+ ],
if (ex != null && fit.lastSummaryFor(ex.id) != null) ...[
const SizedBox(height: 10),
GestureDetector(
@@ -873,9 +882,37 @@ class SessionScreen extends StatelessWidget {
children: [
Row(children: [
Expanded(
- child: Text(fit.sessionProgressLabel,
- style: AppTheme.f(12, weight: FontWeight.w600, color: gc.textSecondary, letterSpacing: 0.4)),
+ child: Row(children: [
+ Flexible(
+ child: Text(fit.sessionProgressLabel,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(12, weight: FontWeight.w600, color: gc.textSecondary, letterSpacing: 0.4)),
+ ),
+ if (fit.sessionVolumeKg > 0) ...[
+ Text(' · ', style: AppTheme.f(12, weight: FontWeight.w600, color: gc.textTertiary)),
+ RollingText('${fit.weightValue(fit.sessionVolumeKg)} ${fit.units}',
+ style: AppTheme.f(12, weight: FontWeight.w700, color: gc.text, letterSpacing: 0.2)),
+ ],
+ ]),
),
+ if (!locked && fit.showMiniBody)
+ Semantics(
+ button: true,
+ label: t.sessionMuscles,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () => showSessionMusclesSheet(context),
+ child: Padding(
+ padding: const EdgeInsets.only(left: 8, right: 10),
+ child: MiniBody(
+ sets: fit.sessionMuscleSets.planned,
+ done: fit.sessionMuscleSets.done,
+ height: 28,
+ ),
+ ),
+ ),
+ ),
if (!locked)
Row(mainAxisSize: MainAxisSize.min, children: [
Icon(PhosphorIconsRegular.listBullets, size: 14, color: gc.textSecondary),
@@ -999,7 +1036,7 @@ class SessionScreen extends StatelessWidget {
}
Widget _nextRow(GymColors gc, String id) {
- final target = fit.nextTarget(id)!;
+ final up = fit.nextTarget(id)?.up ?? fit.holdGoesUp(id);
return Padding(
padding: const EdgeInsets.only(top: 4),
child: Row(
@@ -1013,7 +1050,7 @@ class SessionScreen extends StatelessWidget {
final main = TextSpan(
text: fit.nextTargetLabel(id),
style: AppTheme.f(12,
- weight: FontWeight.w600, color: target.up ? gc.ember : gc.textSecondary),
+ weight: FontWeight.w600, color: up ? gc.ember : gc.textSecondary),
);
final why = fit.nextWhy(id);
if (why == null) return Text.rich(main);
@@ -1609,7 +1646,7 @@ class SessionScreen extends StatelessWidget {
? '$working'
: '$working·$tag';
final text = st.rpe == null || fit.logRpe ? base : '$base${fit.effortTag(st.rpe!)}';
- return FittedBox(
+ final label = FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(text,
@@ -1617,6 +1654,77 @@ class SessionScreen extends StatelessWidget {
softWrap: false,
style: AppTheme.f(16, weight: FontWeight.w700, color: _kindColor(gc, st.kind))),
);
+ if (st.note.trim().isEmpty) return label;
+ return Row(mainAxisSize: MainAxisSize.min, children: [
+ Flexible(child: label),
+ const SizedBox(width: 3),
+ Icon(PhosphorIconsFill.notePencil, size: 10, color: gc.accent),
+ ]);
+ }
+
+ Widget _setRestRow(BuildContext context, GymColors gc, int exIdx, int j, int? own, VoidCallback changed) {
+ final normal = fit.normalRestAfter(exIdx, j);
+ final value = own == null ? null : (own == 0 ? t.noRestTimer : clockLabel(own));
+ Future<void> pick() async {
+ final start = own ?? (normal > 0 ? normal : 90);
+ final v = await askRuler(context,
+ title: t.restAfterThisSet,
+ value: ((start / 5).round() * 5).clamp(5, 900).toDouble(),
+ min: 5,
+ max: 900,
+ step: 5,
+ majorEvery: 6,
+ format: (v) => clockLabel(v.round()),
+ tickLabel: (v) => clockLabel(v.round()),
+ clearLabel: t.noRestTimer);
+ if (v == null) return;
+ fit.setSetRest(exIdx, j, v.isNaN ? 0 : v.round());
+ changed();
+ }
+
+ return Container(
+ padding: const EdgeInsets.fromLTRB(14, 6, 6, 6),
+ decoration: BoxDecoration(color: gc.bgRaised2, borderRadius: BorderRadius.circular(16)),
+ child: Row(children: [
+ Icon(PhosphorIconsRegular.timer, size: 17, color: own == null ? gc.textSecondary : gc.accent),
+ const SizedBox(width: 10),
+ Expanded(
+ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Text(t.restAfterThisSet, style: AppTheme.f(13.5, weight: FontWeight.w700, color: gc.text)),
+ const SizedBox(height: 1),
+ Text(
+ own == null
+ ? t.restUsual(normal > 0 ? clockLabel(normal) : t.noRestTimer)
+ : t.restJustToday,
+ style: AppTheme.f(11.5, weight: FontWeight.w500, color: gc.textSecondary)),
+ ]),
+ ),
+ if (own != null)
+ IconButton(
+ tooltip: t.restUseUsual,
+ visualDensity: VisualDensity.compact,
+ onPressed: () {
+ HapticFeedback.selectionClick();
+ fit.setSetRest(exIdx, j, null);
+ changed();
+ },
+ icon: Icon(PhosphorIconsBold.arrowCounterClockwise, size: 14, color: gc.textSecondary),
+ ),
+ Pressable(
+ scale: 0.94,
+ onTap: pick,
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ decoration: BoxDecoration(
+ color: own == null ? gc.bgRaised : gc.accentSoft,
+ borderRadius: BorderRadius.circular(100),
+ ),
+ child: Text(value ?? t.restChange,
+ style: AppTheme.f(12.5, weight: FontWeight.w700, color: own == null ? gc.text : gc.accent)),
+ ),
+ ),
+ ]),
+ );
}
Future<void> _kindSheet(BuildContext context, int exIdx, int j, SetKind current) async {
@@ -1631,10 +1739,7 @@ class SessionScreen extends StatelessWidget {
final kindNow = live?.kind ?? current;
return Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -1650,6 +1755,14 @@ class SessionScreen extends StatelessWidget {
current: kindNow,
onPick: (kind) => setSheet(() => fit.setSetKind(exIdx, j, kind)),
),
+ const SizedBox(height: 14),
+ _setRestRow(sheet, gc, exIdx, j, live?.rest, () => setSheet(() {})),
+ const SizedBox(height: 18),
+ SetNoteField(
+ initial: live?.note ?? '',
+ last: fit.previousSet(fit.session?.exercises[exIdx].id ?? '', j)?.note,
+ onChanged: (v) => fit.setSetNote(exIdx, j, v),
+ ),
const SizedBox(height: 18),
PrimaryButton(label: t.done, onTap: () => Navigator.of(sheet).pop()),
const SizedBox(height: 4),
@@ -1841,28 +1954,28 @@ class SessionScreen extends StatelessWidget {
? t.finishHoldNow
: '${t.stopLabel} · ${durationLabel(fit.holdRemaining ?? 0)}',
onTap: fit.holdPaused ? fit.completeHold : fit.stopHold,
- height: 56,
+ height: 52,
));
}
return PrimaryButton(
label: t.startHold(fit.holdLength(ex.id, ex.sets[pending].sec ?? 30)),
icon: Ic.play,
onTap: () => fit.startHold(exIdx, pending),
- height: 56,
+ height: 52,
);
}
if (pending >= 0) {
- return PrimaryButton(label: t.setDone, onTap: () => fit.toggleSet(exIdx, pending), height: 56);
+ return PrimaryButton(label: t.setDone, onTap: () => fit.toggleSet(exIdx, pending), height: 52);
}
if (fit.pendingAfter(exIdx) != null) {
- return PrimaryButton(label: t.nextExercise, onTap: fit.goNextPending, height: 56);
+ return PrimaryButton(label: t.nextExercise, onTap: fit.goNextPending, height: 52);
}
if (exIdx < total - 1) {
return _guard(
- locked, PrimaryButton(label: t.nextExercise, onTap: fit.nextExercise, height: 56));
+ locked, PrimaryButton(label: t.nextExercise, onTap: fit.nextExercise, height: 52));
}
return _guard(
- locked, PrimaryButton(label: t.finishSession, onTap: fit.finishSession, height: 56));
+ locked, PrimaryButton(label: t.finishSession, onTap: fit.finishSession, height: 52));
}
Widget _textAction(GymColors gc, String label, VoidCallback onTap) => Semantics(
@@ -1946,6 +2059,14 @@ class SessionScreen extends StatelessWidget {
child: Rise(index: 3, child: _levelUpCard(context, gc, fit.summaryLevelUp!)),
),
),
+ if (fit.askCheckIn && fit.filedSession != null) ...[
+ const SizedBox(height: 10),
+ Rise(index: 3, child: CheckInCard(fit.filedSession!)),
+ ],
+ if (fit.sessionExtras.isNotEmpty || identical(_extrasFor, fit.session)) ...[
+ const SizedBox(height: 10),
+ const Rise(index: 3, child: _ExtrasCard()),
+ ],
if (fit.filedSession case final filed?) ...[
const SizedBox(height: 10),
Rise(index: 3, child: SessionPhotos(filed)),
@@ -2265,7 +2386,7 @@ class SessionScreen extends StatelessWidget {
),
);
return SoftCard(
- radius: 20,
+ radius: 22,
padding: const EdgeInsets.fromLTRB(14, 14, 14, 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -2286,7 +2407,7 @@ class SessionScreen extends StatelessWidget {
Icon(PhosphorIconsBold.trendUp, size: 13, color: gc.sage),
const SizedBox(width: 6),
Text(t.levelUpKicker,
- style: AppTheme.f(10.5, weight: FontWeight.w800, color: gc.sage, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.sage, letterSpacing: 1.4)),
]),
const SizedBox(height: 4),
Text(exerciseName(level.to),
@@ -2379,7 +2500,7 @@ void showAddToSessionSheet(BuildContext context) {
context: context,
isScrollControlled: true,
backgroundColor: gc.bgRaised,
- shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(24))),
+ shape: sheetShape(gc),
builder: (sheetCtx) => Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(sheetCtx).viewInsets.bottom),
child: StatefulBuilder(
@@ -2459,7 +2580,7 @@ void showSwapExerciseSheet(BuildContext context, int exIdx) {
context: context,
isScrollControlled: true,
backgroundColor: gc.bgRaised,
- shape: const RoundedRectangleBorder(borderRadius: BorderRadius.vertical(top: Radius.circular(24))),
+ shape: sheetShape(gc),
builder: (sheetCtx) => Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(sheetCtx).viewInsets.bottom),
child: StatefulBuilder(
@@ -2714,10 +2835,7 @@ void showSessionOverview(BuildContext context) {
return Container(
padding: sheetPad(sheet),
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.86),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -2860,67 +2978,6 @@ Widget _overviewRow(BuildContext sheet, GymColors gc, WorkoutSession s, int i) {
);
}
-void showExerciseHistorySheet(BuildContext context, String exerciseId) {
- final gc = context.gc;
- final history = fit.exerciseHistory(exerciseId).take(8).toList();
- final ex = fit.exerciseById(exerciseId);
- showAppSheet<void>(
- context: context,
- isScrollControlled: true,
- backgroundColor: Colors.transparent,
- builder: (sheet) => Container(
- padding: sheetPad(sheet),
- constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.8),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
- child: SingleChildScrollView(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- const SheetHandle(),
- const SizedBox(height: 18),
- Text(ex == null ? '' : exerciseName(ex),
- style: AppTheme.f(19, weight: FontWeight.w800, color: gc.text)),
- const SizedBox(height: 4),
- Text(titleCase(t.history),
- style: AppTheme.f(12.5, weight: FontWeight.w500, color: gc.textSecondary)),
- const SizedBox(height: 14),
- if (history.isEmpty)
- Text(t.noHistory, style: AppTheme.f(13, weight: FontWeight.w500, color: gc.textSecondary)),
- for (var i = 0; i < history.length; i++)
- Container(
- padding: const EdgeInsets.symmetric(vertical: 12),
- decoration: BoxDecoration(
- border: i < history.length - 1
- ? Border(bottom: BorderSide(color: gc.border.withValues(alpha: 0.55)))
- : null,
- ),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- SizedBox(
- width: 92,
- child: Text(t.shortDate(history[i].date),
- style: AppTheme.f(13, weight: FontWeight.w600, color: gc.text)),
- ),
- Expanded(
- child: Text(fit.setsSummary(history[i].ex.sets),
- style: AppTheme.f(12.5,
- weight: FontWeight.w500, color: gc.textSecondary, height: 1.4)),
- ),
- ],
- ),
- ),
- ],
- ),
- ),
- ),
- );
-}
-
void _showLockHint(BuildContext context) {
HapticFeedback.heavyImpact();
showNotchToast(
@@ -3108,3 +3165,188 @@ class _CelebrateState extends State<_Celebrate> {
@override
Widget build(BuildContext context) => widget.child;
}
+
+Object? _extrasFor;
+
+class _ExtrasCard extends StatefulWidget {
+ const _ExtrasCard();
+
+ @override
+ State<_ExtrasCard> createState() => _ExtrasCardState();
+}
+
+class _ExtrasCardState extends State<_ExtrasCard> {
+ late final List<SessionExercise> _extras = fit.sessionExtras;
+ final Set<String> _added = {};
+
+ @override
+ void initState() {
+ super.initState();
+ _extrasFor = fit.session;
+ }
+
+ String _summary(SessionExercise e) {
+ final working = e.sets.where((st) => st.done && st.counts).toList();
+ final done = working.isEmpty ? e.sets.where((st) => st.done).toList() : working;
+ return fit.setsSummary([for (final st in done) st.logged]);
+ }
+
+ String _name(SessionExercise e) {
+ final ex = fit.exerciseById(e.id);
+ return ex == null ? e.name : exerciseName(ex);
+ }
+
+ void _add(SessionExercise e) {
+ if (!fit.addExtraToRoutine(e.id)) return;
+ HapticFeedback.mediumImpact();
+ setState(() => _added.add(e.id));
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ final gc = context.gc;
+ final routine = fit.sessionRoutine;
+ if (_extras.isEmpty || routine == null) return const SizedBox.shrink();
+ return SoftCard(
+ radius: 22,
+ padding: const EdgeInsets.fromLTRB(16, 16, 16, 8),
+ child: Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
+ Text(t.newInWorkout.toUpperCase(),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.brass, letterSpacing: 1.4)),
+ const SizedBox(height: 4),
+ Text(t.newInWorkoutHint(fit.routineTitle(routine)),
+ style: AppTheme.f(12.5, weight: FontWeight.w500, color: gc.textSecondary, height: 1.35)),
+ const SizedBox(height: 8),
+ for (final e in _extras)
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 8),
+ child: Row(children: [
+ if (fit.exerciseById(e.id) case final ex?)
+ SizedBox(width: 44, child: ExerciseMedia(ex: ex, height: 44, radius: 12)),
+ const SizedBox(width: 12),
+ Expanded(
+ child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
+ Text(_name(e),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(14, weight: FontWeight.w700, color: gc.text)),
+ const SizedBox(height: 2),
+ Text(_summary(e),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(12, weight: FontWeight.w500, color: gc.textSecondary)),
+ ]),
+ ),
+ const SizedBox(width: 10),
+ Pressable(
+ scale: 0.94,
+ onTap: _added.contains(e.id) ? null : () => _add(e),
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 220),
+ curve: Curves.easeOutCubic,
+ padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
+ decoration: BoxDecoration(
+ color: _added.contains(e.id) ? gc.sageSoft : gc.bgRaised2,
+ borderRadius: BorderRadius.circular(100),
+ ),
+ child: AnimatedSwitcher(
+ duration: const Duration(milliseconds: 200),
+ child: _added.contains(e.id)
+ ? Row(key: const ValueKey('done'), mainAxisSize: MainAxisSize.min, children: [
+ Icon(PhosphorIconsBold.check, size: 13, color: gc.sage),
+ const SizedBox(width: 5),
+ Text(t.addedToRoutine, style: AppTheme.f(12.5, weight: FontWeight.w700, color: gc.sage)),
+ ])
+ : Row(key: const ValueKey('add'), mainAxisSize: MainAxisSize.min, children: [
+ Icon(PhosphorIconsBold.plus, size: 13, color: gc.text),
+ const SizedBox(width: 5),
+ Text(t.addShort, style: AppTheme.f(12.5, weight: FontWeight.w700, color: gc.text)),
+ ]),
+ ),
+ ),
+ ),
+ ]),
+ ),
+ ]),
+ );
+ }
+}
+
+void showSessionMusclesSheet(BuildContext context) {
+ showAppSheet<void>(
+ context: context,
+ isScrollControlled: true,
+ backgroundColor: Colors.transparent,
+ builder: (sheet) => AnimatedBuilder(
+ animation: fit,
+ builder: (sheet, _) {
+ final gc = sheet.gc;
+ final m = fit.sessionMuscleSets;
+ final ids = m.planned.keys.toList()..sort((a, b) => m.planned[b]!.compareTo(m.planned[a]!));
+ String n(double v) => v == v.roundToDouble() ? '${v.round()}' : fmt((v * 10).round() / 10);
+ return Container(
+ padding: sheetPad(sheet),
+ constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(sheet).height * 0.86),
+ decoration: sheetDecoration(gc),
+ child: SingleChildScrollView(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ const SheetHandle(),
+ const SizedBox(height: 18),
+ Text(t.sessionMuscles, style: AppTheme.f(19, weight: FontWeight.w800, color: gc.text)),
+ const SizedBox(height: 4),
+ Text(t.sessionMusclesHint, style: AppTheme.f(12.5, weight: FontWeight.w500, color: gc.textSecondary)),
+ const SizedBox(height: 18),
+ LayoutBuilder(
+ builder: (context, box) => Center(
+ child: MiniBody(sets: m.planned, done: m.done, height: box.maxWidth * kBodyAspect),
+ ),
+ ),
+ const SizedBox(height: 18),
+ for (final id in ids)
+ Padding(
+ padding: const EdgeInsets.symmetric(vertical: 7),
+ child: Row(children: [
+ SizedBox(
+ width: 110,
+ child: Text(t.muscle(id),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(13, weight: FontWeight.w600, color: gc.text)),
+ ),
+ Expanded(
+ child: ClipRRect(
+ borderRadius: BorderRadius.circular(4),
+ child: TweenAnimationBuilder<double>(
+ tween: Tween(end: ((m.done[id] ?? 0) / m.planned[id]!).clamp(0.0, 1.0)),
+ duration: const Duration(milliseconds: 420),
+ curve: Curves.easeOutCubic,
+ builder: (_, v, _) => LinearProgressIndicator(
+ value: v,
+ minHeight: 8,
+ backgroundColor: gc.bgRaised2,
+ color: heatRamp(gc, fit.heatTone)[heatLevels - 1],
+ ),
+ ),
+ ),
+ ),
+ const SizedBox(width: 12),
+ SizedBox(
+ width: 52,
+ child: Text('${n(m.done[id] ?? 0)}/${n(m.planned[id]!)}',
+ textAlign: TextAlign.right,
+ style: AppTheme.f(12.5, weight: FontWeight.w700, color: gc.textSecondary)
+ .copyWith(fontFeatures: const [FontFeature.tabularFigures()])),
+ ),
+ ]),
+ ),
+ ],
+ ),
+ ),
+ );
+ },
+ ),
+ );
+}
diff --git a/lib/screens/share_sheet.dart b/lib/screens/share_sheet.dart
index fe5ce4a..6e70274 100644
--- a/lib/screens/share_sheet.dart
+++ b/lib/screens/share_sheet.dart
@@ -83,11 +83,7 @@ class _ShareSheetState extends State<_ShareSheet> {
return Container(
constraints: BoxConstraints(maxHeight: MediaQuery.of(context).size.height * 0.9),
- decoration: BoxDecoration(
- color: gc.bg,
-
- borderRadius: const BorderRadius.vertical(top: Radius.circular(26)),
- ),
+ decoration: sheetDecoration(gc),
clipBehavior: Clip.antiAlias,
child: SafeArea(
top: false,
@@ -151,7 +147,7 @@ class _ShareSheetState extends State<_ShareSheet> {
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 6, 20, 16),
- child: PrimaryButton(label: sentenceCase(t.share), height: 54, onTap: _share),
+ child: PrimaryButton(label: sentenceCase(t.share), height: 52, onTap: _share),
),
],
),
diff --git a/lib/screens/start_sheet.dart b/lib/screens/start_sheet.dart
index bd6c4d8..2302bc6 100644
--- a/lib/screens/start_sheet.dart
+++ b/lib/screens/start_sheet.dart
@@ -34,11 +34,7 @@ class StartSheet extends StatelessWidget {
return Container(
constraints: BoxConstraints(maxHeight: MediaQuery.sizeOf(context).height * 0.82),
padding: sheetPad(context),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
@@ -90,7 +86,7 @@ class StartSheet extends StatelessWidget {
Widget _label(GymColors gc, String text) => Padding(
padding: const EdgeInsets.only(left: 4, bottom: 8),
child: Text(text.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.2)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
);
Widget _plannedCard(BuildContext context, GymColors gc, Routine r) {
@@ -110,7 +106,7 @@ class StartSheet extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(day == null ? t.todaysRoutine : t.plannedRoutine,
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.brass, letterSpacing: 1.2)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.brass, letterSpacing: 1.4)),
const SizedBox(height: 6),
Text(fit.routineTitle(r),
maxLines: 1,
diff --git a/lib/screens/sticker_screen.dart b/lib/screens/sticker_screen.dart
index 72a9536..5e64077 100644
--- a/lib/screens/sticker_screen.dart
+++ b/lib/screens/sticker_screen.dart
@@ -231,10 +231,7 @@ class _StickerEditorState extends State<StickerEditor> {
final swatches = _swatches(gc);
return Container(
padding: const EdgeInsets.fromLTRB(16, 14, 16, 12),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(26)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
diff --git a/lib/screens/timeline_screen.dart b/lib/screens/timeline_screen.dart
index 1ea6d52..26c819b 100644
--- a/lib/screens/timeline_screen.dart
+++ b/lib/screens/timeline_screen.dart
@@ -141,7 +141,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
child: PrimaryButton(
label: t.addTodayPhotos,
icon: Ic.plus,
- height: 54,
+ height: 52,
onTap: _busy ? () {} : () => _poseSheet(DateTime.now()),
),
),
@@ -259,7 +259,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
),
const SizedBox(height: 10),
SoftCard(
- radius: 18,
+ radius: 16,
padding: const EdgeInsets.symmetric(vertical: 12),
child: Center(
child: BodyHeatArt(
@@ -689,11 +689,7 @@ class _TimelineScreenState extends State<TimelineScreen> {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(context),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
diff --git a/lib/screens/tool_detail_screen.dart b/lib/screens/tool_detail_screen.dart
index f987882..98a3393 100644
--- a/lib/screens/tool_detail_screen.dart
+++ b/lib/screens/tool_detail_screen.dart
@@ -266,7 +266,7 @@ class ToolDetailScreen extends StatelessWidget {
}
return SoftCard(
- radius: 20,
+ radius: 22,
borderColor: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Column(
@@ -288,7 +288,7 @@ class ToolDetailScreen extends StatelessWidget {
Widget _macros(GymColors gc) {
Widget card(String label, String value) => Expanded(
child: SoftCard(
- radius: 20,
+ radius: 22,
borderColor: Colors.transparent,
padding: const EdgeInsets.all(12),
child: Column(children: [
@@ -329,7 +329,7 @@ class ToolDetailScreen extends StatelessWidget {
}
return SoftCard(
- radius: 20,
+ radius: 22,
borderColor: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Column(
@@ -355,7 +355,7 @@ class ToolDetailScreen extends StatelessWidget {
final target = fit.toDisplayWeight(fit.plateTarget);
final loadable = fit.loadableTotal(target, fit.plateBarDisplay);
return SoftCard(
- radius: 20,
+ radius: 22,
borderColor: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Column(
@@ -393,7 +393,7 @@ class ToolDetailScreen extends StatelessWidget {
behavior: HitTestBehavior.opaque,
onTap: weight > bar ? () => showPlateSheet(context, weight) : null,
child: SoftCard(
- radius: 20,
+ radius: 22,
borderColor: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
child: Row(
@@ -423,7 +423,7 @@ class ToolDetailScreen extends StatelessWidget {
Widget _warmupCard(GymColors gc) {
final sets = fit.warmupSets;
return SoftCard(
- radius: 20,
+ radius: 22,
borderColor: Colors.transparent,
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Column(
@@ -460,10 +460,7 @@ void showPlateSheet(BuildContext context, double displayTarget, {double? startBa
final loadable = fit.loadableTotal(displayTarget, bar);
return Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
diff --git a/lib/screens/train_screen.dart b/lib/screens/train_screen.dart
index 55c513b..c3a8c02 100644
--- a/lib/screens/train_screen.dart
+++ b/lib/screens/train_screen.dart
@@ -137,7 +137,7 @@ class _TrainScreenState extends State<TrainScreen> {
),
const SizedBox(height: 26),
Text(t.orStartWith.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.5)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const SizedBox(height: 10),
IntrinsicHeight(
child: Row(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
@@ -268,7 +268,7 @@ class _TrainScreenState extends State<TrainScreen> {
Widget _sectionLabel(GymColors gc, String label) => Padding(
padding: const EdgeInsets.only(bottom: 10, left: 2),
child: Text(label.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
);
Widget _gearChip(GymColors gc, String label, bool on, String? value) => Padding(
diff --git a/lib/widgets/auto_backup_sheet.dart b/lib/widgets/auto_backup_sheet.dart
index 22076db..ede1e2d 100644
--- a/lib/widgets/auto_backup_sheet.dart
+++ b/lib/widgets/auto_backup_sheet.dart
@@ -53,10 +53,7 @@ void showAutoBackupSheet(BuildContext context) {
final i = AutoBackup.keepOptions.indexOf(b.keep);
return Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
diff --git a/lib/widgets/muscle_radar.dart b/lib/widgets/muscle_radar.dart
index 9b2f576..06a651e 100644
--- a/lib/widgets/muscle_radar.dart
+++ b/lib/widgets/muscle_radar.dart
@@ -2,7 +2,8 @@ import 'dart:math' as math;
import 'package:flutter/material.dart';
-import '../catalog/body_svg.dart';
+import '../catalog/body_art.dart';
+import 'body_map.dart' show clipMuscles, currentBody, paintBodyBase;
import '../l10n/l10n.dart';
import '../state/fit_state.dart';
import '../theme/app_colors.dart';
@@ -67,7 +68,7 @@ class _MuscleRadarCardState extends State<MuscleRadarCard> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(t.radarTitle.toUpperCase(),
- style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.3)),
+ style: AppTheme.f(10.5, weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
const SizedBox(height: 6),
Text(t.radarHint, style: AppTheme.f(13, weight: FontWeight.w500, color: gc.textSecondary)),
const SizedBox(height: 10),
@@ -212,10 +213,11 @@ class _RadarPainter extends CustomPainter {
}
class MuscleFigurePainter extends CustomPainter {
- MuscleFigurePainter({required this.gc, required this.muscle});
+ MuscleFigurePainter({required this.gc, required this.muscle}) : art = currentBody;
final GymColors gc;
final String muscle;
+ final BodyArt art;
static Rect _half(String id) =>
_backView.contains(id) ? const Rect.fromLTRB(270, 0, 540, 462) : const Rect.fromLTRB(0, 0, 262, 462);
@@ -229,10 +231,10 @@ class MuscleFigurePainter extends CustomPainter {
static final _content = <String, Rect>{};
- static Rect content(String id) => _content.putIfAbsent(id, () {
+ static Rect content(String id) => _content.putIfAbsent('${currentBody.id}$id', () {
final box = crop(id).intersect(_half(id));
var l = double.infinity, t = double.infinity, r = -double.infinity, b = -double.infinity;
- for (final d in [...bodyBaseMain, ...bodyBaseLite]) {
+ for (final d in [...currentBody.base, ...currentBody.lite, ...currentBody.head]) {
for (final m in svgPath(d).computeMetrics()) {
for (var at = 0.0; at < m.length; at += 2) {
final p = m.getTangentForOffset(at)?.position;
@@ -261,10 +263,9 @@ class MuscleFigurePainter extends CustomPainter {
canvas.translate(-crop.left, -crop.top);
canvas.clipRect(_half(muscle));
final paint = Paint()..isAntiAlias = true;
- for (final d in [...bodyBaseMain, ...bodyBaseLite]) {
- canvas.drawPath(svgPath(d), paint..color = skin);
- }
- for (final e in muscleFills.entries) {
+ paintBodyBase(canvas, art, skin, skin);
+ clipMuscles(canvas, art);
+ for (final e in art.fills.entries) {
paint.color = lit.contains(e.key) ? gc.accent : rest;
for (final d in e.value) {
canvas.drawPath(svgPath(d), paint);
@@ -273,5 +274,5 @@ class MuscleFigurePainter extends CustomPainter {
}
@override
- bool shouldRepaint(MuscleFigurePainter old) => old.gc != gc || old.muscle != muscle;
+ bool shouldRepaint(MuscleFigurePainter old) => old.gc != gc || old.muscle != muscle || old.art != art;
}
diff --git a/lib/widgets/note_kit.dart b/lib/widgets/note_kit.dart
index 0889042..20499cd 100644
--- a/lib/widgets/note_kit.dart
+++ b/lib/widgets/note_kit.dart
@@ -195,10 +195,7 @@ Future<void> showNoteDaySheet(BuildContext context, DateTime day) async {
backgroundColor: Colors.transparent,
builder: (sheet) => Container(
padding: sheetPad(context, bottom: 26),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,
diff --git a/lib/widgets/routine_folder.dart b/lib/widgets/routine_folder.dart
index 8510143..13a5f2f 100644
--- a/lib/widgets/routine_folder.dart
+++ b/lib/widgets/routine_folder.dart
@@ -1,4 +1,7 @@
+import 'dart:math' as math;
+
import 'package:flutter/material.dart';
+import 'body_map.dart';
import 'package:phosphoricons_flutter/phosphoricons_flutter.dart';
import '../l10n/l10n.dart';
@@ -20,6 +23,9 @@ const kFolderHues = [
Color folderHue(Routine r) =>
kFolderHues[(r.color >= 0 ? r.color : r.id.codeUnits.fold<int>(0, (a, c) => a + c)) % kFolderHues.length];
+double routineFolderHeight(BuildContext context) =>
+ math.max(196, 16 + 50 + 46 + 22 + MediaQuery.textScalerOf(context).scale(16) * 1.15 * 2 + 36);
+
class RoutineFolder extends StatelessWidget {
const RoutineFolder({super.key, required this.routine, required this.onMenu, this.lastDone = false});
@@ -49,7 +55,7 @@ class RoutineFolder extends StatelessWidget {
onTap: () => fit.openRoutine(r.id),
scale: 0.975,
child: SizedBox(
- height: 196,
+ height: routineFolderHeight(context),
child: Stack(
children: [
Positioned(
@@ -165,16 +171,24 @@ class RoutineFolder extends StatelessWidget {
],
),
const Spacer(),
- Text(
- [
- if (r.group.isNotEmpty && ago == null) r.group,
- t.exerciseCount(n),
- if (ago != null) t.lastDoneAgo(ago),
- ].join(' · '),
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: AppTheme.f(11.5, weight: FontWeight.w600, color: gc.textSecondary),
- ),
+ Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
+ Expanded(
+ child: Text(
+ [
+ if (r.group.isNotEmpty && ago == null) r.group,
+ t.exerciseCount(n),
+ if (ago != null) t.lastDoneAgo(ago),
+ ].join(' · '),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(11.5, weight: FontWeight.w600, color: gc.textSecondary),
+ ),
+ ),
+ if (n > 0 && fit.showMiniBody) ...[
+ const SizedBox(width: 6),
+ MiniBody(sets: fit.routineMuscleSets(r), height: 32),
+ ],
+ ]),
],
),
),
diff --git a/lib/widgets/ruler_picker.dart b/lib/widgets/ruler_picker.dart
index c198c26..0a0281e 100644
--- a/lib/widgets/ruler_picker.dart
+++ b/lib/widgets/ruler_picker.dart
@@ -290,10 +290,7 @@ Future<double?> askRuler(
);
return Container(
padding: sheetPad(sheet),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
- ),
+ decoration: sheetDecoration(gc),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch,