199 Commits

Author SHA1 Message Date
Roland Geider
54c6ce0175 Refactor the log entry form in the gym mode.
Previously due to rebuilds the form would e.g. not stay open after
selecting a new unit (which would also not change)
2026-02-11 13:37:33 +01:00
Roland Geider
a367678b91 Properly filter dayData entries
This is needed when the "needs logs to advance" toggle is active

See https://github.com/wger-project/wger/issues/2164
2026-02-09 22:49:30 +01:00
Roland Geider
53dcbd8c6c Don't mark nullable fields as "late"
These will be null and we avoid LateInitializationError errors

See #1079
2026-01-16 15:26:38 +01:00
Roland Geider
fb6a673503 Simplify code by adding new log provider
This makes the logic for copying or modifying the logs much easier. Also,
there were some user reports that the old logic sometimes behaved erratically
and old values were sometimes reverted.
2026-01-12 21:40:11 +01:00
Roland Geider
6a2158a397 Reload the session page in the gym mode
This makes sure that we have the current state and don't try to create a new session
which already exists
2025-12-18 11:59:26 +01:00
Roland Geider
d187324a25 Properly handle null values
Basically all the fields can be nullable, so we need to set them if
we want to avoid LateInitialisation errors.
2025-12-18 10:58:40 +01:00
Roland Geider
06b32a2bd9 Better volume calculations, other cleanup 2025-12-04 12:14:57 +01:00
Roland Geider
aeb01a517b Refactor widgets used in logs
We should try to reuse as many as possible in the end-of-gym-mode logs and in
the routine log page
2025-11-27 15:08:06 +01:00
Roland Geider
ecd0b6c6b4 Add overview page when a workout has been completed 2025-11-26 20:17:02 +01:00
Roland Geider
9f66815e10 Merge branch 'master' into feature/gym-mode
# 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
2025-11-19 19:18:45 +01:00
Roland Geider
fc881c4929 Properly handle timezones
This should (hopefully 🤞) take care of problems saving entries with timezone
information.
2025-11-18 16:30:52 +01:00
Roland Geider
c26e3828f8 Allow adding additional exercises to the workout
While these are not real ad-hoc workouts, at least it's a first step
2025-11-15 23:44:42 +01:00
Roland Geider
f1f37d3e03 Allow swapping exercises in the gym mode 2025-11-15 01:32:59 +01:00
Roland Geider
ae6db6ee07 Move to riverpod three
Needed to downgrade build_runner and mockito for now
2025-11-11 13:22:18 +01:00
Roland Geider
b0d1bce9aa Consistently show the day and type name 2025-10-16 23:48:15 +02:00
Roland Geider
1f6d22d85a Tweak a bit how and when the types are shown 2025-10-09 23:11:10 +02:00
Roland Geider
39b503e03a Format files as in master 2025-10-09 17:54:24 +02:00
Roland Geider
85ba00b654 Merge branch 'master' into feature/day-type
# Conflicts:
#	lib/models/workouts/day.g.dart
#	lib/models/workouts/day_data.g.dart
#	lib/models/workouts/set_config_data.g.dart
#	lib/models/workouts/slot_data.g.dart
#	lib/models/workouts/slot_entry.g.dart
#	lib/models/workouts/weight_unit.g.dart
#	test/auth/auth_screen_test.mocks.dart
#	test/core/settings_test.mocks.dart
#	test/exercises/contribute_exercise_test.mocks.dart
#	test/gallery/gallery_form_test.mocks.dart
#	test/gallery/gallery_screen_test.mocks.dart
#	test/measurements/measurement_categories_screen_test.mocks.dart
#	test/measurements/measurement_provider_test.mocks.dart
#	test/nutrition/nutritional_meal_form_test.mocks.dart
#	test/nutrition/nutritional_plan_form_test.mocks.dart
#	test/nutrition/nutritional_plan_screen_test.mocks.dart
#	test/nutrition/nutritional_plans_screen_test.mocks.dart
#	test/other/base_provider_test.mocks.dart
#	test/routine/day_form_test.mocks.dart
#	test/routine/gym_mode_screen_test.mocks.dart
#	test/routine/gym_mode_session_screen_test.mocks.dart
#	test/routine/repetition_unit_form_widget_test.mocks.dart
#	test/routine/routine_edit_screen_test.mocks.dart
#	test/routine/routine_edit_test.mocks.dart
#	test/routine/routine_form_test.mocks.dart
#	test/routine/routine_logs_screen_test.mocks.dart
#	test/routine/routine_screen_test.mocks.dart
#	test/routine/routines_provider_test.mocks.dart
#	test/routine/routines_screen_test.mocks.dart
#	test/routine/slot_entry_form_test.mocks.dart
#	test/routine/weight_unit_form_widget_test.mocks.dart
#	test/user/provider_test.mocks.dart
#	test/weight/weight_provider_test.mocks.dart
#	test/weight/weight_screen_test.mocks.dart
2025-10-09 17:39:39 +02:00
Roland Geider
93a11a16e4 Recreate generated files and reformat the repo
Seems the default dart formatting rules changed recently, and this was causing
huge diffs in branches
2025-10-09 17:39:02 +02:00
Roland Geider
6146201531 Allow setting the slot entry type as well 2025-10-09 17:28:23 +02:00
Roland Geider
949ad02ab6 Add generated files
It seems a recent update changes the way dart code is formatted
2025-10-08 12:45:37 +02:00
Roland Geider
39be6a3edf Allow setting the day type in the edit form 2025-10-06 11:36:27 +02:00
Roland Geider
798406eaa9 Make routineId nullable in session and related files
Sessions can be added ad-hoc, without needing to be part of any specific
routine.
2025-09-16 14:47:47 +02:00
Roland Geider
70fba34f0c Better handling of time zones
We now send the current time zone to the server when serializing datetime objects.
This was causing entries to be saved some hours wrong or depending on the time, on
a different day.
2025-05-26 11:13:53 +02:00
Roland Geider
a4c103c6b4 Remove default rounding values
These only make sense when using automatic progression rules (and then, only with
increase steps with percentages). If no rounding values are set, the value will
be simply used as-is.
2025-05-14 11:35:58 +02:00
Roland Geider
d663bcd88a Move common logic to SessionForm
Refactor and polish a bit the form in the log overview.
2025-05-09 21:12:49 +02:00
Roland Geider
7f42b47f97 Actually set the RiR value in the logs 2025-04-27 16:10:41 +02:00
Roland Geider
1ecbfa88d1 Correctly set the start and end time to null, if this is what comes from the API 2025-04-18 00:40:05 +02:00
Roland Geider
bc0672d81b Correctly initialize the data in form from existing session
Also, add some simple tests for this
2025-04-17 17:30:01 +02:00
Roland Geider
88d66b336c Properly update the UI when deleting workout logs
The problem was that we were passing the exercises and session from the
calendar events, which wasn't being reloaded when the logs were deleted. Now
we only pass the selected date and fetch the logs from the routine.
2025-04-17 10:26:44 +02:00
Roland Geider
e31c54365b Also convert the rpe to a number
This was causing some errors when loading routines that had a defined RiR
2025-03-29 14:32:39 +01:00
Roland Geider
cacb89f8b1 Replace WEIGHT_UNIT_KG_ID
No need to have two constants for the same thing
2025-03-28 17:21:41 +01:00
Roland Geider
74752505eb Change rir and rirTarget types from String to num
This is more consistent with the other fields and is now the same as the backend
2025-03-26 15:03:15 +01:00
Roland Geider
b681c264b3 Allow the session ID to be nullable
This will be filled in automatically by the backend
2025-03-19 10:19:54 +01:00
Roland Geider
567843aec8 Set the default value to fitInWeek to true
This is the same behaviour as in the web application is what most people
most like will be doing anyway.
2025-03-17 19:27:43 +01:00
Roland Geider
e26da371e6 Correctly calculate the current iteration 2025-03-14 13:37:11 +01:00
Roland Geider
6e01df2622 Use better type for requirements
(which are not editable on the flutter application anyway)
2025-03-13 14:45:35 +01:00
Roland Geider
f8e4304a01 Use better conversion function, the (max) rest time can be null 2025-03-13 14:42:48 +01:00
Roland Geider
4f94a6a41e Make the repetition and weight units nullable as per the backend 2025-02-21 16:37:16 +01:00
Roland Geider
14a5d7285b Extract the day data for the current routine
instead of loading the same data from the server
2025-02-16 21:19:17 +01:00
Roland Geider
460b6e7125 Add smoke test for fetchAndSetRoutineFull 2025-02-02 22:38:05 +01:00
Roland Geider
2498183094 Rename further instances of "reps" to "repetitions" 2025-02-01 19:24:15 +01:00
Roland Geider
323b18320f Rename key to be more consistent 2025-02-01 15:34:00 +01:00
Roland Geider
5e389664b7 Make LogChartWidgetFl work again 2025-01-31 18:11:35 +01:00
Roland Geider
5058498c4f Allow passing all parameters to the WorkoutSession constructor 2025-01-31 16:24:56 +01:00
Roland Geider
4bd16f5c0d Remove logs from the routine
The logs are now in the session list and can be easily extracted if needed
2025-01-30 18:21:09 +01:00
Roland Geider
7c6fbebdf5 Show workout session information 2025-01-26 20:11:21 +01:00
Roland Geider
b4f8a59a70 Add the newly created session to the routine 2025-01-26 15:07:37 +01:00
Roland Geider
c0935506ed Load the session data from the new API as well
Also, edit or add a session in the gym mode
2025-01-25 21:50:30 +01:00
Roland Geider
13998ec3c0 Don't load the routine every time the log page are accessed 2025-01-25 20:07:19 +01:00