mirror of
https://github.com/kuhyx/screen-locker.git
synced 2026-11-12 08:30:54 +01:00
Allow an extra workout after done today
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWZ9CKZsNxtD5Jr9bYD
This commit is contained in:
parent
23ad2e02b4
commit
17dac66a11
@ -52,7 +52,7 @@ class _WorkoutCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 6),
|
const SizedBox(height: 6),
|
||||||
Text(
|
Text(
|
||||||
'Next: Workout $type — tomorrow',
|
'Next: Workout $type',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: colorScheme.onSurface,
|
color: colorScheme.onSurface,
|
||||||
fontSize: AppTextSize.body,
|
fontSize: AppTextSize.body,
|
||||||
@ -103,7 +103,9 @@ class _WorkoutCard extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
else if (!doneToday)
|
else
|
||||||
|
// Never hidden by "done today": the PC pays for every further
|
||||||
|
// session, so an extra workout must stay one tap away.
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
|
|||||||
@ -1,15 +1,10 @@
|
|||||||
import 'dart:async';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
|
||||||
import 'package:workout_app/models/workout_plan.dart';
|
import 'package:workout_app/models/workout_plan.dart';
|
||||||
import 'package:workout_app/screens/home_screen.dart';
|
|
||||||
import 'package:workout_app/screens/workout_screen.dart';
|
import 'package:workout_app/screens/workout_screen.dart';
|
||||||
import 'package:workout_app/services/storage_service.dart';
|
import 'package:workout_app/services/storage_service.dart';
|
||||||
import 'package:workout_app/services/workout_sync_service.dart';
|
|
||||||
import 'package:workout_app/ui/theme.dart';
|
|
||||||
import 'package:workout_app/widgets/sync_status_card.dart';
|
|
||||||
|
|
||||||
import '../fake_secure_storage.dart';
|
import '../fake_secure_storage.dart';
|
||||||
import '_home_test_fixtures.dart';
|
import '_home_test_fixtures.dart';
|
||||||
@ -74,8 +69,17 @@ void main() {
|
|||||||
json: '{"exercises":[]}',
|
json: '{"exercises":[]}',
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
// Finishing A is what makes B the next workout (saveSession alone does
|
||||||
|
// not move the A/B rotation).
|
||||||
|
await tester.runAsync(
|
||||||
|
() => StorageService.instance.setLastWorkoutType('A'),
|
||||||
|
);
|
||||||
await pumpHome(tester, wrapHome());
|
await pumpHome(tester, wrapHome());
|
||||||
expect(find.text('Done for today!'), findsOneWidget);
|
expect(find.text('Done for today!'), findsOneWidget);
|
||||||
|
// An extra session is still allowed: the PC pays for further ones.
|
||||||
|
expect(find.text('Start Workout B'), findsOneWidget);
|
||||||
|
// The run entry must not vanish either.
|
||||||
|
expect(find.byKey(const Key('home_run')), findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('manual-workout icon navigates to the manual form', (
|
testWidgets('manual-workout icon navigates to the manual form', (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user