Skip to content

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

Rebuild the home around a single hero and stop the weekly plan wrapping (#33)

InlitXcea5da897df1
diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart
index 587680f..a07794f 100644
--- a/lib/screens/home_screen.dart
+++ b/lib/screens/home_screen.dart
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
-import 'package:phosphor_flutter/phosphor_flutter.dart';
+import 'package:phosphoricons_flutter/phosphoricons_flutter.dart';
import '../l10n/l10n.dart';
import '../models/exercise.dart';
@@ -17,151 +17,237 @@ class HomeScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final gc = context.gc;
- final now = DateTime.now();
- final dateLabel = t.longDate(now);
- final recommended = fit.recommendedExercises(6);
+ final recommended = fit.recommendedExercises(8);
return SafeArea(
bottom: false,
child: SingleChildScrollView(
- padding: const EdgeInsets.fromLTRB(20, 12, 20, 110),
+ padding: const EdgeInsets.fromLTRB(20, 14, 20, 116),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
+ _topBar(gc),
+ const SizedBox(height: 20),
+ _hero(context, gc),
+ const SizedBox(height: 14),
+ _weekCard(gc),
+ if (fit.photoDue) ...[
+ const SizedBox(height: 14),
+ _photoNudge(gc),
+ ],
+ const SizedBox(height: 30),
+ _heading(gc, t.thisWeek),
+ const SizedBox(height: 14),
+ _weekStats(context, gc),
+ const SizedBox(height: 30),
+ _heading(gc, t.activityLabel, onMore: fit.goProgress),
+ const SizedBox(height: 14),
+ SoftCard(
+ radius: 22,
+ padding: const EdgeInsets.fromLTRB(18, 18, 18, 16),
+ child: Heatmap(levels: fit.heatmapLevels, mono: true),
+ ),
+ if (recommended.isNotEmpty) ...[
+ const SizedBox(height: 30),
+ _heading(gc, t.recommended, onMore: fit.goExercises),
+ const SizedBox(height: 14),
+ SizedBox(
+ height: 158,
+ child: ListView.separated(
+ scrollDirection: Axis.horizontal,
+ itemCount: recommended.length,
+ separatorBuilder: (_, _) => const SizedBox(width: 12),
+ itemBuilder: (_, i) => _recCard(gc, recommended[i]),
+ ),
+ ),
+ ],
+ const SizedBox(height: 30),
Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(t.today,
- style: AppTheme.s(11, weight: FontWeight.w600, color: gc.textTertiary, letterSpacing: 1.5)),
- const SizedBox(height: 2),
- Text(dateLabel, style: AppTheme.d(20, weight: FontWeight.w600, color: gc.text)),
- ],
+ Expanded(
+ child: _tile(gc, PhosphorIconsRegular.listChecks, t.routines, fit.goRoutines),
),
- GestureDetector(
- onTap: fit.goProgress,
- child: Container(
- padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
- decoration: BoxDecoration(color: gc.emberSoft, borderRadius: BorderRadius.circular(100)),
- child: Row(children: [
- SvgPathIcon(Ic.flame, size: 16, color: gc.accent),
- const SizedBox(width: 6),
- Text('${fit.currentStreak}', style: AppTheme.d(14, weight: FontWeight.w600, color: gc.accent)),
- ]),
- ),
+ const SizedBox(width: 12),
+ Expanded(child: _tile(gc, PhosphorIconsRegular.wrench, t.tools, fit.goTools)),
+ const SizedBox(width: 12),
+ Expanded(
+ child: _tile(gc, PhosphorIconsRegular.notebook, t.journal, fit.goNotes,
+ badge: fit.notes.length),
),
],
),
- const SizedBox(height: 22),
- _FocusHero(),
- const SizedBox(height: 22),
- if (fit.todayRoutine != null) ...[
- _todayRoutine(gc),
- const SizedBox(height: 22),
- ],
- if (fit.photoDue) ...[
- _photoNudge(gc),
- const SizedBox(height: 22),
+ ],
+ ),
+ ),
+ );
+ }
+
+ Widget _topBar(GymColors gc) {
+ return Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(t.today.toUpperCase(),
+ style: AppTheme.f(10.5,
+ weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
+ const SizedBox(height: 3),
+ Text(t.longDate(DateTime.now()),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(21, color: gc.text)),
],
- SoftCard(
- radius: 20,
- padding: const EdgeInsets.all(18),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [for (int i = 0; i < 7; i++) _weekDay(gc, i)],
+ ),
+ ),
+ const SizedBox(width: 12),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: fit.goProgress,
+ child: Container(
+ padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 9),
+ decoration: BoxDecoration(color: gc.bgRaised, borderRadius: BorderRadius.circular(100)),
+ child: Row(
+ children: [
+ SvgPathIcon(Ic.flame, size: 15, color: gc.accent),
+ const SizedBox(width: 6),
+ Text('${fit.currentStreak}',
+ style: AppTheme.f(14, weight: FontWeight.w800, color: gc.text)),
+ ],
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+
+ String _tc(String s) => titleCase(s);
+
+ Widget _heading(GymColors gc, String title, {VoidCallback? onMore}) {
+ return GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: onMore,
+ child: Row(
+ children: [
+ Text(_tc(title), style: AppTheme.f(19, color: gc.text)),
+ const Spacer(),
+ if (onMore != null)
+ Icon(PhosphorIconsBold.caretRight, size: 14, color: gc.textTertiary),
+ ],
+ ),
+ );
+ }
+
+ Widget _hero(BuildContext context, GymColors gc) {
+ final routine = fit.todayRoutine;
+ final focus = fit.suggestedFocus;
+ final isRoutine = routine != null && routine.exerciseIds.isNotEmpty;
+ final label = isRoutine ? t.todaysRoutine : t.todaysFocus;
+ final title = isRoutine ? fit.routineTitle(routine) : focus.title;
+ final subtitle = isRoutine
+ ? t.exerciseCount(routine.exerciseIds.length)
+ : (fit.hasData
+ ? '${focus.subtitle} · ${t.exerciseCount(fit.getFilteredExercises(focus.muscles).length)}'
+ : t.firstSessionHint);
+
+ return ClipRRect(
+ borderRadius: BorderRadius.circular(26),
+ child: Container(
+ decoration: BoxDecoration(
+ color: gc.bgRaised,
+ borderRadius: BorderRadius.circular(26),
+ ),
+ child: Stack(
+ children: [
+ Positioned(
+ right: -6,
+ top: -2,
+ bottom: 62,
+ child: Opacity(
+ opacity: 0.45,
+ child: Image.asset('assets/img/runner.png', fit: BoxFit.fitHeight),
),
),
- const SizedBox(height: 22),
- Text(t.thisWeek,
- style: AppTheme.d(12, weight: FontWeight.w600, color: gc.textSecondary, letterSpacing: 3)),
- const SizedBox(height: 10),
- Row(children: [
- Expanded(child: _stat(gc, t.volume, fit.volumeValue(fit.volumeThisWeekKg), unit: ' ${fit.volumeUnit}')),
- const SizedBox(width: 12),
- Expanded(child: _stat(gc, t.setsToday, '${fit.setsToday}')),
- ]),
- const SizedBox(height: 12),
- Row(children: [
- Expanded(child: _stat(gc, t.prs, '${fit.prsThisWeek}', valueColor: gc.ember)),
- const SizedBox(width: 12),
- Expanded(child: _goalCard(gc)),
- ]),
- const SizedBox(height: 22),
- _activityCard(gc),
- const SizedBox(height: 22),
- Text(t.recommended,
- style: AppTheme.d(12, weight: FontWeight.w600, color: gc.textSecondary, letterSpacing: 3)),
- const SizedBox(height: 10),
- SizedBox(
- height: 150,
- child: ListView.builder(
- scrollDirection: Axis.horizontal,
- itemCount: recommended.length,
- itemBuilder: (context, i) => _recCard(gc, recommended[i]),
+ Padding(
+ padding: const EdgeInsets.fromLTRB(22, 22, 22, 20),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(label.toUpperCase(),
+ style: AppTheme.f(10.5,
+ weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.4)),
+ const SizedBox(height: 9),
+ Padding(
+ padding: const EdgeInsets.only(right: 96),
+ child: Text(title,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(30,
+ weight: FontWeight.w800, color: gc.text, height: 1.1)),
+ ),
+ const SizedBox(height: 7),
+ Text(subtitle,
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(13, weight: FontWeight.w500, color: gc.textSecondary)),
+ const SizedBox(height: 20),
+ PrimaryButton(
+ label: t.startWorkout,
+ icon: Ic.play,
+ height: 52,
+ onTap: isRoutine ? () => fit.startRoutine(routine) : fit.startFocusWorkout,
+ ),
+ ],
),
),
- const SizedBox(height: 22),
- Row(children: [
- Expanded(child: _quick(gc, Icon(PhosphorIconsRegular.listChecks, size: 22, color: gc.ember), t.routines, fit.goRoutines)),
- const SizedBox(width: 12),
- Expanded(child: _quick(gc, Icon(PhosphorIconsRegular.barbell, size: 22, color: gc.ember), t.exercises, fit.goExercises)),
- ]),
- const SizedBox(height: 12),
- Row(children: [
- Expanded(child: _quick(gc, SvgPathIcon(Ic.wrench, size: 20, color: gc.ember), t.tools, fit.goTools)),
- const SizedBox(width: 12),
- Expanded(
- child: _quick(gc, Icon(PhosphorIconsRegular.notebook, size: 22, color: gc.ember),
- t.journal, fit.goNotes, badge: fit.notes.length)),
- ]),
],
),
),
);
}
+ Widget _weekCard(GymColors gc) {
+ return SoftCard(
+ radius: 22,
+ padding: const EdgeInsets.fromLTRB(14, 16, 14, 16),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ children: [for (int i = 0; i < 7; i++) _weekDay(gc, i)],
+ ),
+ );
+ }
+
Widget _weekDay(GymColors gc, int i) {
final done = fit.isDayDone(i);
final isToday = i == fit.todayIndex;
final isFuture = i > fit.todayIndex;
- Color fill = gc.bgRaised2;
- Border? border;
- double opacity = 1;
- if (done) {
- fill = gc.ember;
- } else if (isToday) {
- border = Border.all(color: gc.ember, width: 2);
- } else if (isFuture) {
- fill = gc.bgRaised2;
- opacity = 0.7;
- } else {
- border = Border.all(color: gc.textTertiary, width: 1.5);
- }
return GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: isFuture ? null : () => fit.toggleCheckin(i),
child: Opacity(
- opacity: opacity,
+ opacity: isFuture ? 0.5 : 1,
child: Column(
children: [
Text(t.weekdayInitial(i + 1),
- style: TextStyle(fontSize: 11, fontWeight: FontWeight.w600, color: isToday ? gc.ember : gc.textTertiary)),
- const SizedBox(height: 8),
+ style: AppTheme.f(10,
+ weight: FontWeight.w700,
+ color: isToday ? gc.text : gc.textTertiary,
+ letterSpacing: 0.5)),
+ const SizedBox(height: 9),
AnimatedContainer(
- duration: const Duration(milliseconds: 200),
- curve: Curves.easeOut,
+ duration: const Duration(milliseconds: 220),
+ curve: Curves.easeOutCubic,
width: 32,
height: 32,
decoration: BoxDecoration(
- color: fill,
+ color: done ? gc.ember : gc.bgRaised2,
shape: BoxShape.circle,
- border: border,
+ border: isToday && !done ? Border.all(color: gc.ember, width: 2) : null,
),
- child: done ? Center(child: SvgPathIcon(Ic.checkBold, size: 14, color: gc.onEmber)) : null,
+ child:
+ done ? Center(child: SvgPathIcon(Ic.checkBold, size: 13, color: gc.onEmber)) : null,
),
],
),
@@ -169,22 +255,34 @@ class HomeScreen extends StatelessWidget {
);
}
- Widget _stat(GymColors gc, String label, String value, {String? unit, Color? valueColor}) {
+ Widget _weekStats(BuildContext context, GymColors gc) {
return SoftCard(
- radius: 18,
- padding: const EdgeInsets.all(16),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ radius: 22,
+ padding: const EdgeInsets.fromLTRB(18, 18, 18, 18),
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
children: [
- Text(label, style: AppTheme.s(11, weight: FontWeight.w600, color: gc.textSecondary, letterSpacing: 1)),
- const SizedBox(height: 4),
- RichText(
- text: TextSpan(
- text: value,
- style: AppTheme.d(28, weight: FontWeight.w700, color: valueColor ?? gc.text),
+ Expanded(
+ child: Row(
+ children: [
+ Expanded(
+ child: _stat(gc, t.volume, fit.volumeValue(fit.volumeThisWeekKg),
+ unit: fit.volumeUnit),
+ ),
+ Expanded(child: _stat(gc, t.setsToday, '${fit.setsToday}')),
+ Expanded(child: _stat(gc, t.prs, '${fit.prsThisWeek}')),
+ ],
+ ),
+ ),
+ GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () => showWeeklyGoalSheet(context),
+ child: Column(
children: [
- if (unit != null)
- TextSpan(text: unit, style: AppTheme.d(16, weight: FontWeight.w700, color: gc.textSecondary)),
+ GoalRing(pct: fit.goalPct.toDouble(), size: 44),
+ const SizedBox(height: 7),
+ Text('${fit.sessionsThisWeek}/${fit.weeklyTarget}',
+ style: AppTheme.f(11, weight: FontWeight.w700, color: gc.textSecondary)),
],
),
),
@@ -193,90 +291,61 @@ class HomeScreen extends StatelessWidget {
);
}
- Widget _activityCard(GymColors gc) {
- return GestureDetector(
- onTap: fit.goProgress,
- child: SoftCard(
- radius: 20,
- padding: const EdgeInsets.all(18),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ Widget _stat(GymColors gc, String label, String value, {String unit = ''}) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(label.toUpperCase(),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(9.5,
+ weight: FontWeight.w600, color: gc.textTertiary, letterSpacing: 0.9)),
+ const SizedBox(height: 6),
+ Row(
+ crossAxisAlignment: CrossAxisAlignment.baseline,
+ textBaseline: TextBaseline.alphabetic,
children: [
- Row(
- children: [
- Text(t.activityLabel,
- style: AppTheme.d(12, weight: FontWeight.w600, color: gc.textSecondary, letterSpacing: 3)),
- const Spacer(),
- SvgPathIcon(Ic.flame, size: 15, color: gc.accent),
- const SizedBox(width: 5),
- Text('${fit.currentStreak}',
- style: AppTheme.d(14, weight: FontWeight.w700, color: gc.accent)),
- const SizedBox(width: 8),
- Icon(PhosphorIconsRegular.caretRight, size: 14, color: gc.textTertiary),
- ],
+ Flexible(
+ child: Text(value,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(23, weight: FontWeight.w800, color: gc.text)),
),
- const SizedBox(height: 14),
- Heatmap(levels: fit.heatmapLevels),
+ if (unit.isNotEmpty) ...[
+ const SizedBox(width: 3),
+ Text(unit,
+ style: AppTheme.f(11, weight: FontWeight.w600, color: gc.textSecondary)),
+ ],
],
),
- ),
+ ],
);
}
- Widget _goalCard(GymColors gc) {
- return SoftCard(
- radius: 18,
- padding: const EdgeInsets.all(16),
- child: Row(
- children: [
- GoalRing(pct: fit.goalPct.toDouble()),
- const SizedBox(width: 12),
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(t.goal, style: AppTheme.s(11, weight: FontWeight.w600, color: gc.textSecondary, letterSpacing: 1)),
- const SizedBox(height: 2),
- RichText(
- text: TextSpan(
- text: '${fit.goalPct}',
- style: AppTheme.d(22, weight: FontWeight.w700, color: gc.text),
- children: [
- TextSpan(text: '%', style: AppTheme.d(14, weight: FontWeight.w700, color: gc.textSecondary)),
- ],
- ),
- ),
- ],
- ),
- ],
- ),
- );
- }
-
- Widget _quick(GymColors gc, Widget iconWidget, String label, VoidCallback onTap, {int badge = 0}) {
+ Widget _tile(GymColors gc, IconData icon, String label, VoidCallback onTap, {int badge = 0}) {
return GestureDetector(
+ behavior: HitTestBehavior.opaque,
onTap: onTap,
child: SoftCard(
- radius: 18,
- padding: const EdgeInsets.all(16),
+ radius: 20,
+ padding: const EdgeInsets.fromLTRB(14, 16, 14, 14),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
- SizedBox(height: 22, child: iconWidget),
+ Icon(icon, size: 20, color: gc.textSecondary),
const Spacer(),
if (badge > 0)
Text('$badge',
- style: AppTheme.d(13, weight: FontWeight.w600, color: gc.textTertiary)),
+ style: AppTheme.f(11, weight: FontWeight.w700, color: gc.textTertiary)),
],
),
- const SizedBox(height: 10),
- FittedBox(
- fit: BoxFit.scaleDown,
- alignment: Alignment.centerLeft,
- child: Text(label,
- maxLines: 1, style: AppTheme.d(14, weight: FontWeight.w600, color: gc.text, letterSpacing: 1)),
- ),
+ const SizedBox(height: 14),
+ Text(_tc(label),
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(13, weight: FontWeight.w700, color: gc.text)),
],
),
),
@@ -286,91 +355,53 @@ class HomeScreen extends StatelessWidget {
Widget _photoNudge(GymColors gc) {
return GestureDetector(
behavior: HitTestBehavior.opaque,
- onTap: fit.goTimeline,
+ onTap: fit.goMoments,
child: SoftCard(
- radius: 20,
- padding: const EdgeInsets.all(18),
- borderColor: gc.accent,
+ radius: 22,
+ padding: const EdgeInsets.fromLTRB(18, 16, 18, 16),
child: Row(
children: [
- Icon(PhosphorIconsRegular.camera, size: 20, color: gc.accent),
+ Icon(PhosphorIconsRegular.camera, size: 19, color: gc.accent),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(t.photoDueNow,
- style: AppTheme.d(15, weight: FontWeight.w700, color: gc.text)),
+ Text(t.photoDueNow, style: AppTheme.f(14.5, color: gc.text)),
const SizedBox(height: 2),
Text(t.photoInterval(fit.photoIntervalDays),
- style: AppTheme.s(12, color: gc.textSecondary)),
+ style: AppTheme.f(12, weight: FontWeight.w500, color: gc.textSecondary)),
],
),
),
- Icon(PhosphorIconsRegular.caretRight, size: 15, color: gc.textTertiary),
+ Icon(PhosphorIconsBold.caretRight, size: 14, color: gc.textTertiary),
],
),
),
);
}
- Widget _todayRoutine(GymColors gc) {
- final r = fit.todayRoutine!;
- final n = r.exerciseIds.length;
- return SoftCard(
- radius: 20,
- padding: const EdgeInsets.all(18),
- child: Row(
- children: [
- Expanded(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(t.todaysRoutine,
- style: AppTheme.d(11, weight: FontWeight.w600, color: gc.brass, letterSpacing: 2)),
- const SizedBox(height: 4),
- Text(fit.routineTitle(r), style: AppTheme.d(22, weight: FontWeight.w700, color: gc.text)),
- const SizedBox(height: 2),
- Text(t.exerciseCount(n), style: AppTheme.s(13, color: gc.textSecondary)),
- ],
- ),
- ),
- if (n > 0)
- GestureDetector(
- onTap: () => fit.startRoutine(r),
- child: Container(
- width: 52,
- height: 52,
- decoration: BoxDecoration(color: gc.ember, shape: BoxShape.circle),
- child: Icon(PhosphorIconsFill.play, size: 22, color: gc.onEmber),
- ),
- ),
- ],
- ),
- );
- }
-
Widget _recCard(GymColors gc, Exercise ex) {
return GestureDetector(
+ behavior: HitTestBehavior.opaque,
onTap: () => fit.openExercise(ex.id),
child: Container(
- width: 128,
- margin: const EdgeInsets.only(right: 12),
- padding: const EdgeInsets.all(8),
+ width: 132,
+ padding: const EdgeInsets.all(9),
decoration: BoxDecoration(
color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: BorderRadius.circular(16),
+ borderRadius: BorderRadius.circular(18),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- ExerciseMedia(ex: ex, height: 84, radius: 10),
- const SizedBox(height: 8),
+ ExerciseMedia(ex: ex, height: 88, radius: 12),
+ const SizedBox(height: 9),
Expanded(
child: Text(exerciseName(ex),
- maxLines: 2, overflow: TextOverflow.ellipsis,
- style: AppTheme.s(12, weight: FontWeight.w600, color: gc.text, height: 1.2)),
+ maxLines: 2,
+ overflow: TextOverflow.ellipsis,
+ style: AppTheme.f(12, weight: FontWeight.w600, color: gc.text, height: 1.25)),
),
],
),
@@ -379,62 +410,49 @@ class HomeScreen extends StatelessWidget {
}
}
-class _FocusHero extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- final gc = context.gc;
- final focus = fit.suggestedFocus;
- final count = fit.getFilteredExercises(focus.muscles).length;
- final subtitle = fit.hasData
- ? '${focus.subtitle} · ${t.exerciseCount(count)}'
- : t.firstSessionHint;
- return ClipRRect(
- borderRadius: BorderRadius.circular(24),
- child: Container(
+void showWeeklyGoalSheet(BuildContext context) {
+ final gc = context.gc;
+ showModalBottomSheet<void>(
+ context: context,
+ backgroundColor: Colors.transparent,
+ builder: (sheet) => StatefulBuilder(
+ builder: (sheet, setSheet) => Container(
+ padding: sheetPad(sheet),
decoration: BoxDecoration(
color: gc.bgRaised,
- border: Border.all(color: gc.border),
- borderRadius: BorderRadius.circular(24),
+ borderRadius: const BorderRadius.vertical(top: Radius.circular(28)),
),
- child: Stack(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- Positioned(
- left: -45,
- bottom: -45,
- child: Container(
- width: 150,
- height: 150,
- decoration: BoxDecoration(color: gc.accentSoft, shape: BoxShape.circle),
- ),
- ),
- Positioned(
- right: -14,
- top: -6,
- bottom: -6,
- child: Opacity(
- opacity: 0.55,
- child: Image.asset('assets/img/runner.png', fit: BoxFit.fitHeight),
- ),
- ),
- Padding(
- padding: const EdgeInsets.all(24),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(t.todaysFocus,
- style: AppTheme.d(12, weight: FontWeight.w600, color: gc.brass, letterSpacing: 3)),
- const SizedBox(height: 8),
- Text(focus.title, style: AppTheme.d(48, weight: FontWeight.w700, color: gc.text, letterSpacing: 1)),
- const SizedBox(height: 8),
- Text(subtitle, style: AppTheme.s(14, color: gc.textSecondary)),
- const SizedBox(height: 20),
- PrimaryButton(label: t.startWorkout, icon: Ic.play, onTap: fit.startFocusWorkout),
- ],
+ const SheetHandle(),
+ const SizedBox(height: 20),
+ Text(t.weeklyGoal,
+ textAlign: TextAlign.center,
+ style: AppTheme.f(19, color: gc.text)),
+ const SizedBox(height: 6),
+ Text(t.sessionsLogged(fit.sessionsThisWeek),
+ textAlign: TextAlign.center,
+ style: AppTheme.f(12.5, weight: FontWeight.w500, color: gc.textSecondary)),
+ const SizedBox(height: 20),
+ Center(
+ child: StepperControl(
+ value: t.perWeek(fit.profile.weeklyGoal),
+ minWidth: 148,
+ onDec: () => setSheet(() => fit.updateProfile(weeklyGoalDelta: -1)),
+ onInc: () => setSheet(() => fit.updateProfile(weeklyGoalDelta: 1)),
),
),
+ const SizedBox(height: 16),
+ Text(t.onbGoalWhy,
+ textAlign: TextAlign.center,
+ style: AppTheme.f(12, weight: FontWeight.w500, color: gc.textSecondary, height: 1.45)),
+ const SizedBox(height: 22),
+ PrimaryButton(label: t.done, onTap: () => Navigator.of(sheet).pop()),
],
),
),
- );
- }
+ ),
+ );
}
diff --git a/lib/screens/train_screen.dart b/lib/screens/train_screen.dart
index ebd8654..fa84a2c 100644
--- a/lib/screens/train_screen.dart
+++ b/lib/screens/train_screen.dart
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
-import 'package:phosphor_flutter/phosphor_flutter.dart';
+import 'package:phosphoricons_flutter/phosphoricons_flutter.dart';
import '../l10n/l10n.dart';
import '../models/exercise.dart';
@@ -48,14 +48,14 @@ class _TrainScreenState extends State<TrainScreen> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RoundBtn(icon: Ic.closeThin, onTap: fit.closeTrain),
- Text(t.train, style: AppTheme.d(16, weight: FontWeight.w700, color: gc.text, letterSpacing: 2)),
+ Text(titleCase(t.train), style: AppTheme.f(18, weight: FontWeight.w800, color: gc.text)),
const SizedBox(width: 36),
],
),
),
Expanded(
child: SingleChildScrollView(
- padding: const EdgeInsets.fromLTRB(20, 20, 20, 24),
+ padding: const EdgeInsets.fromLTRB(20, 20, 20, 12),
child: review ? _review(context, gc) : _select(context, gc),
),
),
@@ -68,11 +68,7 @@ class _TrainScreenState extends State<TrainScreen> {
Widget _startBar(BuildContext context, GymColors gc) {
final n = fit.sessionPicks.length;
return Container(
- padding: EdgeInsets.fromLTRB(20, 12, 20, 12 + MediaQuery.of(context).padding.bottom),
- decoration: BoxDecoration(
- color: gc.bgRaised,
- border: Border(top: BorderSide(color: gc.border)),
- ),
+ padding: EdgeInsets.fromLTRB(20, 8, 20, 14 + MediaQuery.of(context).padding.bottom),
child: PrimaryButton(
label: n == 0 ? t.pickAnExercise : t.startCount(n),
bg: n == 0 ? gc.bgRaised2 : gc.ember,
@@ -87,15 +83,16 @@ class _TrainScreenState extends State<TrainScreen> {
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
- Text(t.step1, style: AppTheme.d(11, weight: FontWeight.w600, color: gc.brass, letterSpacing: 3)),
+ Text(t.step1.toUpperCase(),
+ style: AppTheme.f(10.5,
+ weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.5)),
const SizedBox(height: 4),
- Text(t.chooseFocus, style: AppTheme.d(26, weight: FontWeight.w700, color: gc.text, letterSpacing: 1)),
+ Text(t.chooseFocus, style: AppTheme.f(28, weight: FontWeight.w800, color: gc.text)),
const SizedBox(height: 18),
Container(
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(
color: gc.bgRaised,
- border: Border.all(color: gc.border),
borderRadius: BorderRadius.circular(24),
),
child: BodyMap(
@@ -105,7 +102,7 @@ class _TrainScreenState extends State<TrainScreen> {
),
const SizedBox(height: 6),
Text(t.tapMuscles,
- textAlign: TextAlign.center, style: AppTheme.s(12, color: gc.textTertiary)),
+ textAlign: TextAlign.center, style: AppTheme.f(12, weight: FontWeight.w500, color: gc.textTertiary)),
const SizedBox(height: 14),
Container(
constraints: const BoxConstraints(minHeight: 38),
@@ -117,7 +114,7 @@ class _TrainScreenState extends State<TrainScreen> {
children: [for (final id in fit.selectedMuscles) _chip(gc, id)],
)
: Text(t.noMusclesYet,
- style: AppTheme.s(13, color: gc.textTertiary)),
+ style: AppTheme.f(13, weight: FontWeight.w500, color: gc.textTertiary)),
),
const SizedBox(height: 18),
PrimaryButton(
@@ -135,7 +132,7 @@ class _TrainScreenState extends State<TrainScreen> {
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(color: gc.emberSoft, borderRadius: BorderRadius.circular(100)),
child: Row(mainAxisSize: MainAxisSize.min, children: [
- Text(t.muscle(id), style: AppTheme.s(13, weight: FontWeight.w600, color: gc.ember)),
+ Text(t.muscle(id), style: AppTheme.f(13, weight: FontWeight.w600, color: gc.ember)),
const SizedBox(width: 6),
GestureDetector(
onTap: () => fit.toggleMuscle(id),
@@ -162,8 +159,10 @@ class _TrainScreenState extends State<TrainScreen> {
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(t.step2, style: AppTheme.d(11, weight: FontWeight.w600, color: gc.brass, letterSpacing: 3)),
- Text(t.buildSession, style: AppTheme.d(20, weight: FontWeight.w700, color: gc.text)),
+ Text(t.step2.toUpperCase(),
+ style: AppTheme.f(10.5,
+ weight: FontWeight.w700, color: gc.textTertiary, letterSpacing: 1.5)),
+ Text(t.buildSession, style: AppTheme.f(22, weight: FontWeight.w800, color: gc.text)),
],
),
],
@@ -173,7 +172,7 @@ class _TrainScreenState extends State<TrainScreen> {
const SizedBox(height: 14),
if (!searching && exercises.isNotEmpty) ...[
Text(t.pickedHint(exercises.length),
- style: AppTheme.s(12, color: gc.textTertiary)),
+ style: AppTheme.f(12, weight: FontWeight.w500, color: gc.textTertiary)),
const SizedBox(height: 12),
],
if (exercises.isEmpty)
@@ -197,7 +196,6 @@ class _TrainScreenState extends State<TrainScreen> {
padding: const EdgeInsets.symmetric(horizontal: 16),
decoration: BoxDecoration(
color: gc.bgRaised,
- border: Border.all(color: gc.border),
borderRadius: BorderRadius.circular(100),
),
child: Row(children: [
@@ -207,13 +205,13 @@ class _TrainScreenState extends State<TrainScreen> {
child: TextField(
controller: _searchCtrl,
onChanged: (v) => setState(() => _q = v),
- style: AppTheme.s(14, color: gc.text),
+ style: AppTheme.f(14, weight: FontWeight.w500, color: gc.text),
cursorColor: gc.accent,
decoration: InputDecoration(
isCollapsed: true,
border: InputBorder.none,
hintText: t.searchAllExercises,
- hintStyle: AppTheme.s(14, color: gc.textSecondary),
+ hintStyle: AppTheme.f(14, weight: FontWeight.w500, color: gc.textSecondary),
),
),
),
@@ -241,7 +239,6 @@ class _TrainScreenState extends State<TrainScreen> {
decoration: BoxDecoration(
color: gc.emberSoft,
borderRadius: BorderRadius.circular(14),
- border: Border.all(color: gc.border),
),
child: Icon(PhosphorIconsRegular.plus, size: 20, color: gc.ember),
),
@@ -257,7 +254,7 @@ class _TrainScreenState extends State<TrainScreen> {
child: Column(
children: [
Text(t.noExercisesMatch,
- style: AppTheme.s(15, weight: FontWeight.w600, color: gc.text)),
+ style: AppTheme.f(15, weight: FontWeight.w600, color: gc.text)),
const SizedBox(height: 10),
GestureDetector(
behavior: HitTestBehavior.opaque,
@@ -268,7 +265,7 @@ class _TrainScreenState extends State<TrainScreen> {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Text(t.createItInstead,
- style: AppTheme.s(13, weight: FontWeight.w600, color: gc.accent)),
+ style: AppTheme.f(13, weight: FontWeight.w600, color: gc.accent)),
),
),
],
@@ -280,10 +277,10 @@ class _TrainScreenState extends State<TrainScreen> {
child: Column(
children: [
Text(t.nothingForFocus,
- style: AppTheme.s(15, weight: FontWeight.w600, color: gc.text)),
+ style: AppTheme.f(15, weight: FontWeight.w600, color: gc.text)),
const SizedBox(height: 4),
Text(t.goBackPick,
- textAlign: TextAlign.center, style: AppTheme.s(13, color: gc.textSecondary)),
+ textAlign: TextAlign.center, style: AppTheme.f(13, weight: FontWeight.w500, color: gc.textSecondary)),
],
),
);
@@ -309,12 +306,12 @@ class _TrainScreenState extends State<TrainScreen> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(exerciseName(ex), style: AppTheme.s(14, weight: FontWeight.w600, color: gc.text)),
+ Text(exerciseName(ex), style: AppTheme.f(14, weight: FontWeight.w600, color: gc.text)),
const SizedBox(height: 2),
Text(fit.lastSummaryFor(ex.id) ?? muscleLabel(ex.primary),
maxLines: 1,
overflow: TextOverflow.ellipsis,
- style: AppTheme.s(12, color: gc.textSecondary)),
+ style: AppTheme.f(12, weight: FontWeight.w500, color: gc.textSecondary)),
],
),
),
@@ -325,7 +322,7 @@ class _TrainScreenState extends State<TrainScreen> {
decoration: BoxDecoration(
color: picked ? gc.ember : Colors.transparent,
shape: BoxShape.circle,
- border: Border.all(color: picked ? gc.ember : gc.border, width: 2),
+ border: Border.all(color: picked ? gc.ember : gc.textTertiary, width: 2),
),
child: picked ? Center(child: SvgPathIcon(Ic.checkBold, size: 13, color: gc.onEmber)) : null,
),