-
-
Notifications
You must be signed in to change notification settings - Fork 337
Gym mode improvements #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Needed to downgrade build_runner and mockito for now
This makes the widgets in the gym mode smaller and we can remove a lot of prop drilling that was necessary
The tests should mirror the structure of the regular application
This is easier to open with the thumbs and also makes logical sense. When opening the workout menu from here, the default tab is the progress one, not the overview.
While these are not real ad-hoc workouts, at least it's a first step
Now, the LogPage gets all it's info from the state.
Exercise names are not repeated anymore (again) and we use a bottom sheet now instead of a modal dialog
Note that this shouldn't actually happen, we should find a proper solution
This keeps the progression saved as well as any changed exercises
The modal sheet was causing problems when using the autocompleter, there were overflows and even if we fixed that, there wasn't enough space to comfortably use it
03147f3 to
02a0f89
Compare
983ab9f to
3119429
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request implements significant improvements to the gym mode functionality by refactoring the business logic into a centralized gym state provider. The changes enable more flexible workout tracking with options to customize the workout experience.
Key Changes:
- Refactored gym mode to use Riverpod state management, centralizing business logic in
GymStateProvider - Added user controls to hide/show exercise overviews and timer pages during workouts
- Implemented workout progress tracking with visual indicators and a new progress menu
- Added functionality to swap or add exercises during workouts for more ad-hoc adjustments
- Made time fields optional in the session form
Reviewed Changes
Copilot reviewed 75 out of 78 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
pubspec.yaml |
Upgraded flutter_riverpod to 3.0.3 and added riverpod_annotation/riverpod_generator dependencies |
pubspec.lock |
Updated dependency lock file with new package versions including build_runner downgrade to 2.7.0 |
test/widgets/routines/plate_calculator_test.dart |
Refactored test to use ProviderContainer for improved test isolation |
test/providers/plate_calculator_test.dart |
Updated test to use ProviderContainer pattern |
test/providers/gym_state_test.dart |
Added comprehensive tests for new GymStateNotifier functionality |
test/routine/gym_mode/*.dart |
Restructured gym mode tests with updated mock files and new test structure |
lib/widgets/routines/gym_mode/workout_menu.dart |
New widget implementing workout navigation and progress tracking menus |
lib/widgets/routines/gym_mode/timer.dart |
Simplified timer widgets by removing redundant parameters |
lib/widgets/routines/gym_mode/start_page.dart |
Added gym mode options and refactored to use GymStateProvider |
lib/widgets/routines/gym_mode/session_page.dart |
Converted to ConsumerWidget using GymStateProvider |
lib/widgets/routines/gym_mode/navigation.dart |
Simplified navigation components with state management integration |
lib/widgets/routines/gym_mode/log_page.dart |
Refactored to use GymStateProvider for log management |
lib/widgets/routines/gym_mode/exercise_overview.dart |
Converted to ConsumerWidget with simplified interface |
lib/widgets/routines/forms/session.dart |
Added clear buttons to time input fields |
Multiple .mocks.dart files |
Removed deprecated invalid_use_of_internal_member ignore directive |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # lib/widgets/routines/gym_mode/navigation.dart # pubspec.lock # test/exercises/contribute_exercise_image_test.mocks.dart # test/exercises/contribute_exercise_test.mocks.dart # test/nutrition/nutritional_meal_form_test.mocks.dart # test/nutrition/nutritional_plan_form_test.mocks.dart
Proposed Changes
Improvements to the gym mode. The code has been split up so that the business logic lives in the gym provider.
New features:
Related Issue(s)
Closes #990
Closes #958
Closes #802
Closes #16
Closes wger-project/wger#2033
Helps somewhat with wger-project/wger#1949
Please check that the PR fulfills these requirements
(run
dart format .)///).