Update comments

This commit is contained in:
Roland Geider
2026-10-29 19:46:53 +01:00
parent ce66da762b
commit bf82e4c343
3 changed files with 7 additions and 14 deletions

View File

@@ -21,10 +21,8 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'workout_progress.freezed.dart';
part 'workout_progress.g.dart';
/// The progress through a running workout, as stored in the preferences
///
/// Only the parts that can't be recalculated are kept. The pages are derived
/// from the routine again and matched by their keys.
/// The progress through a running workout, as stored in the preferences. The
/// pages themselves are derived from the routine again and matched by key.
@freezed
sealed class WorkoutProgress with _$WorkoutProgress {
const factory WorkoutProgress({

View File

@@ -147,11 +147,8 @@ class GymStateNotifier extends _$GymStateNotifier {
);
}
/// Stores the progress through the running workout
///
/// Riverpod keeps the state alive for as long as the app is running, but the
/// OS can kill a backgrounded app at any point, e.g. while the user switches
/// to a music app between two sets.
/// Stores the progress through the running workout, since the OS can kill a
/// backgrounded app at any point, e.g. between two sets
Future<void> _saveProgress() async {
// Before initData there is no dayId to store the progress under
if (!state.isInitialized) {
@@ -186,10 +183,8 @@ class GymStateNotifier extends _$GymStateNotifier {
_logger.finer('Cleared stored workout progress');
}
/// Opens gym mode for a day and returns the page to start on
///
/// Continues the workout still in memory as it is, otherwise starts a new one
/// that picks up the progress stored before the app was killed, if any.
/// Opens gym mode for a day and returns the page to start on. Continues the
/// workout in memory, otherwise starts one that picks up any stored progress.
Future<int> open(Routine routine, int dayId, int iteration) async {
final resume = _canResume(dayId);
final initialPage = initData(routine, dayId, iteration);

View File

@@ -40,7 +40,7 @@ final class GymStateNotifierProvider extends $NotifierProvider<GymStateNotifier,
}
}
String _$gymStateNotifierHash() => r'1f0009a2972509e3a444896208f3865835ba77a7';
String _$gymStateNotifierHash() => r'd677a108bd0fa3ae52320cfbf6855ae25bdbc6fe';
abstract class _$GymStateNotifier extends $Notifier<GymModeState> {
GymModeState build();