From 2c8e02eb4218b0381ac811fac696e57afb9c6571 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:51:14 +0000 Subject: [PATCH 1/9] Bump faraday from 1.10.4 to 1.10.5 in /ios Bumps [faraday](https://github.com/lostisland/faraday) from 1.10.4 to 1.10.5. - [Release notes](https://github.com/lostisland/faraday/releases) - [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md) - [Commits](https://github.com/lostisland/faraday/compare/v1.10.4...v1.10.5) --- updated-dependencies: - dependency-name: faraday dependency-version: 1.10.5 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- ios/Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index b05f5052b..0c9057739 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -43,7 +43,7 @@ GEM dotenv (2.8.1) emoji_regex (3.2.3) excon (0.112.0) - faraday (1.10.4) + faraday (1.10.5) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -59,11 +59,11 @@ GEM faraday (>= 0.8.0) http-cookie (~> 1.0.0) faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) + faraday-em_synchrony (1.0.1) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) + faraday-multipart (1.2.0) + multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) From 7294f33685bc2068d75faf81f2c14c4279d7b4ee Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 11 Feb 2026 17:30:19 +0100 Subject: [PATCH 2/9] Further increase the default timeout Specially on self-hosted servers the exercise response might take a long time to complete --- lib/providers/base_provider.dart | 2 +- lib/providers/exercises.dart | 4 ++-- lib/providers/nutrition.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/providers/base_provider.dart b/lib/providers/base_provider.dart index 047a0bf65..e13cd847e 100644 --- a/lib/providers/base_provider.dart +++ b/lib/providers/base_provider.dart @@ -29,7 +29,7 @@ import 'package:wger/providers/auth.dart'; import 'package:wger/providers/helpers.dart'; /// default timeout for GET requests -const DEFAULT_TIMEOUT = Duration(seconds: 5); +const DEFAULT_TIMEOUT = Duration(seconds: 15); /// Base provider class. /// diff --git a/lib/providers/exercises.dart b/lib/providers/exercises.dart index 7cb01f106..9d1526090 100644 --- a/lib/providers/exercises.dart +++ b/lib/providers/exercises.dart @@ -292,7 +292,7 @@ class ExercisesProvider with ChangeNotifier { _logger.info('Loading all exercises from API'); final exerciseData = await baseProvider.fetchPaginated( baseProvider.makeUrl(exerciseUrlPath, query: {'limit': API_MAX_PAGE_SIZE}), - timeout: const Duration(seconds: 15), // just in case + timeout: const Duration(seconds: 25), // just in case ); final exerciseIds = exerciseData.map((e) => e['id'] as int).toSet(); @@ -369,7 +369,7 @@ class ExercisesProvider with ChangeNotifier { // should be safe. final apiData = await baseProvider.fetch( baseProvider.makeUrl(exerciseInfoUrlPath, id: exerciseId), - timeout: const Duration(seconds: 60), + timeout: const Duration(seconds: 120), ); final exerciseApiData = ExerciseApiData.fromJson(apiData); diff --git a/lib/providers/nutrition.dart b/lib/providers/nutrition.dart index 00346bd32..12435e372 100644 --- a/lib/providers/nutrition.dart +++ b/lib/providers/nutrition.dart @@ -409,7 +409,7 @@ class NutritionPlansProvider with ChangeNotifier { 'limit': API_RESULTS_PAGE_SIZE, }, ), - timeout: const Duration(seconds: 10), + timeout: const Duration(seconds: 20), ); return (response['results'] as List) From 86ce2fc9d63919d5dfdb31b4e54fe3026fc82922 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Wed, 11 Feb 2026 17:37:16 +0100 Subject: [PATCH 3/9] Split up the widgets in log_page.dart file --- lib/widgets/routines/forms/log_form.dart | 209 +++++++++ lib/widgets/routines/forms/repetitions.dart | 192 ++++++++ lib/widgets/routines/forms/reps_unit.dart | 70 --- lib/widgets/routines/forms/slot_entry.dart | 4 +- lib/widgets/routines/forms/weight.dart | 191 ++++++++ lib/widgets/routines/forms/weight_unit.dart | 67 --- lib/widgets/routines/gym_mode/log_page.dart | 419 +----------------- test/routine/gym_mode/gym_mode_test.dart | 4 +- .../repetition_unit_form_widget_test.dart | 2 +- test/routine/slot_entry_form_test.dart | 8 +- .../routine/weight_unit_form_widget_test.dart | 2 +- 11 files changed, 603 insertions(+), 565 deletions(-) create mode 100644 lib/widgets/routines/forms/log_form.dart create mode 100644 lib/widgets/routines/forms/repetitions.dart delete mode 100644 lib/widgets/routines/forms/reps_unit.dart create mode 100644 lib/widgets/routines/forms/weight.dart delete mode 100644 lib/widgets/routines/forms/weight_unit.dart diff --git a/lib/widgets/routines/forms/log_form.dart b/lib/widgets/routines/forms/log_form.dart new file mode 100644 index 000000000..fcd6be0ee --- /dev/null +++ b/lib/widgets/routines/forms/log_form.dart @@ -0,0 +1,209 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2026 - 2026 wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:provider/provider.dart' as provider; +import 'package:wger/core/exceptions/http_exception.dart'; +import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/set_config_data.dart'; +import 'package:wger/providers/gym_log_state.dart'; +import 'package:wger/providers/gym_state.dart'; +import 'package:wger/providers/routines.dart'; +import 'package:wger/widgets/core/progress_indicator.dart'; +import 'package:wger/widgets/routines/forms/repetitions.dart'; +import 'package:wger/widgets/routines/forms/rir.dart'; +import 'package:wger/widgets/routines/forms/weight.dart'; + +class LogFormWidget extends ConsumerStatefulWidget { + final PageController controller; + final SetConfigData configData; + + const LogFormWidget({ + super.key, + required this.controller, + required this.configData, + }); + + @override + _LogFormWidgetState createState() => _LogFormWidgetState(); +} + +class _LogFormWidgetState extends ConsumerState { + final _form = GlobalKey(); + var _detailed = false; + bool _isSaving = false; + + @override + Widget build(BuildContext context) { + final i18n = AppLocalizations.of(context); + final log = ref.watch(gymLogProvider); + + return Form( + key: _form, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + i18n.newEntry, + style: Theme.of(context).textTheme.titleLarge, + textAlign: TextAlign.center, + ), + if (!_detailed) + Row( + children: [ + Flexible( + child: RepetitionInputWidget( + key: const ValueKey('logs-reps-widget'), + valueChange: widget.configData.repetitionsRounding, + ), + ), + const SizedBox(width: 8), + Flexible( + child: WeightInputWidget( + key: const ValueKey('logs-weight-widget'), + valueChange: widget.configData.weightRounding, + ), + ), + ], + ), + if (_detailed) + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Flexible( + child: RepetitionInputWidget( + key: const ValueKey('logs-reps-widget'), + valueChange: widget.configData.repetitionsRounding, + ), + ), + const SizedBox(width: 8), + Flexible( + child: RepetitionUnitInputWidget( + key: const ValueKey('repetition-unit-input-widget'), + log?.repetitionsUnitObj, + onChanged: (v) => ref.read(gymLogProvider.notifier).setRepetitionUnit(v), + ), + ), + const SizedBox(width: 8), + ], + ), + if (_detailed) + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Flexible( + child: WeightInputWidget( + key: const ValueKey('logs-weight-widget'), + valueChange: widget.configData.weightRounding, + ), + ), + const SizedBox(width: 8), + Flexible( + child: WeightUnitInputWidget( + log?.weightUnitObj, + onChanged: (v) => ref.read(gymLogProvider.notifier).setWeightUnit(v), + key: const ValueKey('weight-unit-input-widget'), + ), + ), + const SizedBox(width: 8), + ], + ), + if (_detailed) + RiRInputWidget( + key: const ValueKey('rir-input-widget'), + log?.rir, + onChanged: (value) { + if (log == null) { + return; + } + log.rir = value == '' ? null : num.parse(value); + }, + ), + SwitchListTile( + key: const ValueKey('units-switch'), + dense: true, + title: Text(i18n.setUnitsAndRir), + value: _detailed, + onChanged: (value) { + setState(() { + _detailed = !_detailed; + }); + }, + ), + FilledButton( + key: const ValueKey('save-log-button'), + onPressed: _isSaving + ? null + : () async { + final isValid = _form.currentState!.validate(); + if (!isValid) { + return; + } + _isSaving = true; + _form.currentState!.save(); + + try { + final gymState = ref.read(gymStateProvider); + final gymProvider = ref.read(gymStateProvider.notifier); + + final logToSave = ref.read(gymLogProvider); + await provider.Provider.of( + context, + listen: false, + ).addLog(logToSave!); + final page = gymState.getSlotEntryPageByIndex()!; + gymProvider.markSlotPageAsDone(page.uuid, isDone: true); + + if (mounted) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + duration: const Duration(seconds: 2), + content: Text( + i18n.successfullySaved, + textAlign: TextAlign.center, + ), + ), + ); + } + widget.controller.nextPage( + duration: DEFAULT_ANIMATION_DURATION, + curve: DEFAULT_ANIMATION_CURVE, + ); + setState(() { + _isSaving = false; + }); + } on WgerHttpException { + setState(() { + _isSaving = false; + }); + rethrow; + } finally { + setState(() { + _isSaving = false; + }); + } + }, + child: _isSaving ? const FormProgressIndicator() : Text(i18n.save), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/routines/forms/repetitions.dart b/lib/widgets/routines/forms/repetitions.dart new file mode 100644 index 000000000..dfddb2c91 --- /dev/null +++ b/lib/widgets/routines/forms/repetitions.dart @@ -0,0 +1,192 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020 - 2026 wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:intl/intl.dart'; +import 'package:logging/logging.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/repetition_unit.dart'; +import 'package:wger/providers/gym_log_state.dart'; +import 'package:wger/providers/routines.dart'; + +/// Input widget for repetition units +/// +/// Can be used with a Setting or a Log object +class RepetitionUnitInputWidget extends StatefulWidget { + final RepetitionUnit? initialRepetitionUnit; + final ValueChanged onChanged; + + const RepetitionUnitInputWidget(this.initialRepetitionUnit, {super.key, required this.onChanged}); + + @override + _RepetitionUnitInputWidgetState createState() => _RepetitionUnitInputWidgetState(); +} + +class _RepetitionUnitInputWidgetState extends State { + @override + Widget build(BuildContext context) { + final unitProvider = context.read(); + + RepetitionUnit? selectedWeightUnit = widget.initialRepetitionUnit; + + return DropdownButtonFormField( + initialValue: selectedWeightUnit, + decoration: InputDecoration(labelText: AppLocalizations.of(context).repetitionUnit), + isDense: true, + onChanged: (RepetitionUnit? newValue) { + if (newValue == null) { + return; + } + + setState(() { + selectedWeightUnit = newValue; + widget.onChanged(newValue); + }); + }, + items: unitProvider.repetitionUnits.map>(( + RepetitionUnit value, + ) { + return DropdownMenuItem( + key: Key(value.id.toString()), + value: value, + child: Text(value.name), + ); + }).toList(), + ); + } +} + +class RepetitionInputWidget extends ConsumerStatefulWidget { + final num valueChange; + final TextEditingController? controller; + + const RepetitionInputWidget({ + super.key, + this.controller, + num? valueChange, + }) : valueChange = valueChange ?? 1; + + @override + ConsumerState createState() => _RepetitionInputWidgetState(); +} + +class _RepetitionInputWidgetState extends ConsumerState { + final _logger = Logger('LogsRepsWidget'); + late TextEditingController _controller; + num? _lastReps; + + @override + void initState() { + super.initState(); + _controller = widget.controller ?? TextEditingController(); + } + + @override + void dispose() { + if (widget.controller == null) { + _controller.dispose(); + } + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final numberFormat = NumberFormat.decimalPattern(Localizations.localeOf(context).toString()); + final i18n = AppLocalizations.of(context); + + final logNotifier = ref.read(gymLogProvider.notifier); + final log = ref.watch(gymLogProvider); + final currentReps = log?.repetitions; + + // Only update the controller when the provider value actually changed + if (currentReps != _lastReps) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!mounted) { + return; + } + if (currentReps != null) { + _controller.text = numberFormat.format(currentReps); + } else { + _controller.clear(); + } + _lastReps = currentReps; + }); + } + + return Row( + children: [ + // "Quick-remove" button + IconButton( + icon: const Icon(Icons.remove, color: Colors.black), + onPressed: () { + final base = currentReps ?? 0; + final newValue = base - widget.valueChange; + if (newValue >= 0 && log != null) { + logNotifier.setRepetitions(newValue); + } + }, + ), + + // Text field + Expanded( + child: TextFormField( + decoration: InputDecoration(labelText: i18n.repetitions), + enabled: true, + controller: _controller, + keyboardType: textInputTypeDecimal, + onChanged: (value) { + try { + final newValue = numberFormat.parse(value); + logNotifier.setRepetitions(newValue); + } on FormatException catch (error) { + _logger.finer('Error parsing repetitions: $error'); + } + }, + onSaved: (newValue) { + if (newValue == null || log == null) { + return; + } + logNotifier.setRepetitions(numberFormat.parse(newValue)); + }, + validator: (value) { + if (numberFormat.tryParse(value ?? '') == null) { + return i18n.enterValidNumber; + } + return null; + }, + ), + ), + + // "Quick-add" button + IconButton( + icon: const Icon(Icons.add, color: Colors.black), + onPressed: () { + final base = currentReps ?? 0; + final newValue = base + widget.valueChange; + if (newValue >= 0 && log != null) { + logNotifier.setRepetitions(newValue); + } + }, + ), + ], + ); + } +} diff --git a/lib/widgets/routines/forms/reps_unit.dart b/lib/widgets/routines/forms/reps_unit.dart deleted file mode 100644 index 148765751..000000000 --- a/lib/widgets/routines/forms/reps_unit.dart +++ /dev/null @@ -1,70 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (c) 2020 - 2026 wger Team - * - * wger Workout Manager is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:wger/l10n/generated/app_localizations.dart'; -import 'package:wger/models/workouts/repetition_unit.dart'; -import 'package:wger/providers/routines.dart'; - -/// Input widget for repetition units -/// -/// Can be used with a Setting or a Log object -class RepetitionUnitInputWidget extends StatefulWidget { - final RepetitionUnit? initialRepetitionUnit; - final ValueChanged onChanged; - - const RepetitionUnitInputWidget(this.initialRepetitionUnit, {super.key, required this.onChanged}); - - @override - _RepetitionUnitInputWidgetState createState() => _RepetitionUnitInputWidgetState(); -} - -class _RepetitionUnitInputWidgetState extends State { - @override - Widget build(BuildContext context) { - final unitProvider = context.read(); - - RepetitionUnit? selectedWeightUnit = widget.initialRepetitionUnit; - - return DropdownButtonFormField( - initialValue: selectedWeightUnit, - decoration: InputDecoration(labelText: AppLocalizations.of(context).repetitionUnit), - isDense: true, - onChanged: (RepetitionUnit? newValue) { - if (newValue == null) { - return; - } - - setState(() { - selectedWeightUnit = newValue; - widget.onChanged(newValue); - }); - }, - items: unitProvider.repetitionUnits.map>(( - RepetitionUnit value, - ) { - return DropdownMenuItem( - key: Key(value.id.toString()), - value: value, - child: Text(value.name), - ); - }).toList(), - ); - } -} diff --git a/lib/widgets/routines/forms/slot_entry.dart b/lib/widgets/routines/forms/slot_entry.dart index f3a997972..654cfb1eb 100644 --- a/lib/widgets/routines/forms/slot_entry.dart +++ b/lib/widgets/routines/forms/slot_entry.dart @@ -29,9 +29,9 @@ import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/providers/routines.dart'; import 'package:wger/widgets/core/progress_indicator.dart'; import 'package:wger/widgets/exercises/autocompleter.dart'; -import 'package:wger/widgets/routines/forms/reps_unit.dart'; +import 'package:wger/widgets/routines/forms/repetitions.dart'; import 'package:wger/widgets/routines/forms/rir.dart'; -import 'package:wger/widgets/routines/forms/weight_unit.dart'; +import 'package:wger/widgets/routines/forms/weight.dart'; import 'package:wger/widgets/routines/slot.dart'; class SlotEntryForm extends StatefulWidget { diff --git a/lib/widgets/routines/forms/weight.dart b/lib/widgets/routines/forms/weight.dart new file mode 100644 index 000000000..51987ce96 --- /dev/null +++ b/lib/widgets/routines/forms/weight.dart @@ -0,0 +1,191 @@ +/* + * This file is part of wger Workout Manager . + * Copyright (c) 2020 - 2026 wger Team + * + * wger Workout Manager is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:intl/intl.dart'; +import 'package:logging/logging.dart'; +import 'package:provider/provider.dart'; +import 'package:wger/helpers/consts.dart'; +import 'package:wger/l10n/generated/app_localizations.dart'; +import 'package:wger/models/workouts/weight_unit.dart'; +import 'package:wger/providers/gym_log_state.dart'; +import 'package:wger/providers/plate_weights.dart'; +import 'package:wger/providers/routines.dart'; + +/// Input widget for workout weight units +/// +/// Can be used with a Setting or a Log object +class WeightUnitInputWidget extends StatefulWidget { + final WeightUnit? selectedWeightUnit; + final ValueChanged onChanged; + + const WeightUnitInputWidget(this.selectedWeightUnit, {super.key, required this.onChanged}); + + @override + _WeightUnitInputWidgetState createState() => _WeightUnitInputWidgetState(); +} + +class _WeightUnitInputWidgetState extends State { + @override + Widget build(BuildContext context) { + final unitProvider = context.read(); + + WeightUnit? selectedWeightUnit = widget.selectedWeightUnit; + + return DropdownButtonFormField( + initialValue: selectedWeightUnit, + decoration: InputDecoration(labelText: AppLocalizations.of(context).weightUnit), + onChanged: (WeightUnit? newValue) { + if (newValue == null) { + return; + } + + setState(() { + selectedWeightUnit = newValue; + widget.onChanged(newValue); + }); + }, + items: unitProvider.weightUnits.map>((WeightUnit value) { + return DropdownMenuItem( + key: Key(value.id.toString()), + value: value, + child: Text(value.name), + ); + }).toList(), + ); + } +} + +class WeightInputWidget extends ConsumerStatefulWidget { + final num valueChange; + final TextEditingController? controller; + + const WeightInputWidget({ + super.key, + this.controller, + num? valueChange, + }) : valueChange = valueChange ?? 1.25; + + @override + ConsumerState createState() => _WeightInputWidgetState(); +} + +class _WeightInputWidgetState extends ConsumerState { + final _logger = Logger('LogsWeightWidget'); + late TextEditingController _controller; + num? _lastWeight; + + @override + void initState() { + super.initState(); + _controller = widget.controller ?? TextEditingController(); + } + + @override + void dispose() { + if (widget.controller == null) { + _controller.dispose(); + } + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final numberFormat = NumberFormat.decimalPattern(Localizations.localeOf(context).toString()); + final i18n = AppLocalizations.of(context); + + final plateProvider = ref.read(plateCalculatorProvider.notifier); + final logProvider = ref.read(gymLogProvider.notifier); + final log = ref.watch(gymLogProvider); + final currentWeight = log?.weight; + + // Only update when provider value changed + if (currentWeight != _lastWeight) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (!mounted) { + return; + } + if (currentWeight != null) { + _controller.text = numberFormat.format(currentWeight); + } else { + _controller.clear(); + } + _lastWeight = currentWeight; + }); + } + + return Row( + children: [ + IconButton( + // "Quick-remove" button + icon: const Icon(Icons.remove, color: Colors.black), + onPressed: () { + final base = currentWeight ?? 0; + final newValue = base - widget.valueChange; + if (newValue >= 0 && log != null) { + logProvider.setWeight(newValue); + } + }, + ), + + // Text field + Expanded( + child: TextFormField( + controller: _controller, + decoration: InputDecoration(labelText: i18n.weight), + keyboardType: textInputTypeDecimal, + onChanged: (value) { + try { + final newValue = numberFormat.parse(value); + plateProvider.setWeight(newValue); + logProvider.setWeight(newValue); + } on FormatException catch (error) { + _logger.finer('Error parsing weight: $error'); + } + }, + onSaved: (newValue) { + if (newValue == null || log == null) { + return; + } + logProvider.setWeight(numberFormat.parse(newValue)); + }, + validator: (value) { + if (numberFormat.tryParse(value ?? '') == null) { + return i18n.enterValidNumber; + } + return null; + }, + ), + ), + + // "Quick-add" button + IconButton( + icon: const Icon(Icons.add, color: Colors.black), + onPressed: () { + final base = currentWeight ?? 0; + final newValue = base + widget.valueChange; + if (log != null) { + logProvider.setWeight(newValue); + } + }, + ), + ], + ); + } +} diff --git a/lib/widgets/routines/forms/weight_unit.dart b/lib/widgets/routines/forms/weight_unit.dart deleted file mode 100644 index 04b192ad3..000000000 --- a/lib/widgets/routines/forms/weight_unit.dart +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (c) 2020 - 2026 wger Team - * - * wger Workout Manager is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:wger/l10n/generated/app_localizations.dart'; -import 'package:wger/models/workouts/weight_unit.dart'; -import 'package:wger/providers/routines.dart'; - -/// Input widget for workout weight units -/// -/// Can be used with a Setting or a Log object -class WeightUnitInputWidget extends StatefulWidget { - final WeightUnit? selectedWeightUnit; - final ValueChanged onChanged; - - const WeightUnitInputWidget(this.selectedWeightUnit, {super.key, required this.onChanged}); - - @override - _WeightUnitInputWidgetState createState() => _WeightUnitInputWidgetState(); -} - -class _WeightUnitInputWidgetState extends State { - @override - Widget build(BuildContext context) { - final unitProvider = context.read(); - - WeightUnit? selectedWeightUnit = widget.selectedWeightUnit; - - return DropdownButtonFormField( - initialValue: selectedWeightUnit, - decoration: InputDecoration(labelText: AppLocalizations.of(context).weightUnit), - onChanged: (WeightUnit? newValue) { - if (newValue == null) { - return; - } - - setState(() { - selectedWeightUnit = newValue; - widget.onChanged(newValue); - }); - }, - items: unitProvider.weightUnits.map>((WeightUnit value) { - return DropdownMenuItem( - key: Key(value.id.toString()), - value: value, - child: Text(value.name), - ); - }).toList(), - ); - } -} diff --git a/lib/widgets/routines/gym_mode/log_page.dart b/lib/widgets/routines/gym_mode/log_page.dart index 597fd0581..cd0eef568 100644 --- a/lib/widgets/routines/gym_mode/log_page.dart +++ b/lib/widgets/routines/gym_mode/log_page.dart @@ -20,23 +20,15 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:intl/intl.dart'; import 'package:logging/logging.dart'; -import 'package:provider/provider.dart' as provider; -import 'package:wger/core/exceptions/http_exception.dart'; -import 'package:wger/helpers/consts.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/workouts/log.dart'; -import 'package:wger/models/workouts/set_config_data.dart'; import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/providers/gym_log_state.dart'; import 'package:wger/providers/gym_state.dart'; import 'package:wger/providers/plate_weights.dart'; -import 'package:wger/providers/routines.dart'; import 'package:wger/screens/settings_plates_screen.dart'; import 'package:wger/widgets/core/core.dart'; -import 'package:wger/widgets/core/progress_indicator.dart'; -import 'package:wger/widgets/routines/forms/reps_unit.dart'; -import 'package:wger/widgets/routines/forms/rir.dart'; -import 'package:wger/widgets/routines/forms/weight_unit.dart'; +import 'package:wger/widgets/routines/forms/log_form.dart'; import 'package:wger/widgets/routines/gym_mode/navigation.dart'; import 'package:wger/widgets/routines/plate_calculator.dart'; @@ -209,241 +201,6 @@ class LogsPlatesWidget extends ConsumerWidget { } } -class LogsRepsWidget extends ConsumerStatefulWidget { - final num valueChange; - final TextEditingController? controller; - - const LogsRepsWidget({ - super.key, - this.controller, - num? valueChange, - }) : valueChange = valueChange ?? 1; - - @override - ConsumerState createState() => _LogsRepsWidgetState(); -} - -class _LogsRepsWidgetState extends ConsumerState { - final _logger = Logger('LogsRepsWidget'); - late TextEditingController _controller; - num? _lastReps; - - @override - void initState() { - super.initState(); - _controller = widget.controller ?? TextEditingController(); - } - - @override - void dispose() { - if (widget.controller == null) { - _controller.dispose(); - } - super.dispose(); - } - - @override - Widget build(BuildContext context) { - final numberFormat = NumberFormat.decimalPattern(Localizations.localeOf(context).toString()); - final i18n = AppLocalizations.of(context); - - final logNotifier = ref.read(gymLogProvider.notifier); - final log = ref.watch(gymLogProvider); - final currentReps = log?.repetitions; - - // Only update the controller when the provider value actually changed - if (currentReps != _lastReps) { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (!mounted) { - return; - } - if (currentReps != null) { - _controller.text = numberFormat.format(currentReps); - } else { - _controller.clear(); - } - _lastReps = currentReps; - }); - } - - return Row( - children: [ - // "Quick-remove" button - IconButton( - icon: const Icon(Icons.remove, color: Colors.black), - onPressed: () { - final base = currentReps ?? 0; - final newValue = base - widget.valueChange; - if (newValue >= 0 && log != null) { - logNotifier.setRepetitions(newValue); - } - }, - ), - - // Text field - Expanded( - child: TextFormField( - decoration: InputDecoration(labelText: i18n.repetitions), - enabled: true, - controller: _controller, - keyboardType: textInputTypeDecimal, - onChanged: (value) { - try { - final newValue = numberFormat.parse(value); - logNotifier.setRepetitions(newValue); - } on FormatException catch (error) { - _logger.finer('Error parsing repetitions: $error'); - } - }, - onSaved: (newValue) { - if (newValue == null || log == null) { - return; - } - logNotifier.setRepetitions(numberFormat.parse(newValue)); - }, - validator: (value) { - if (numberFormat.tryParse(value ?? '') == null) { - return i18n.enterValidNumber; - } - return null; - }, - ), - ), - - // "Quick-add" button - IconButton( - icon: const Icon(Icons.add, color: Colors.black), - onPressed: () { - final base = currentReps ?? 0; - final newValue = base + widget.valueChange; - if (newValue >= 0 && log != null) { - logNotifier.setRepetitions(newValue); - } - }, - ), - ], - ); - } -} - -class LogsWeightWidget extends ConsumerStatefulWidget { - final num valueChange; - final TextEditingController? controller; - - const LogsWeightWidget({ - super.key, - this.controller, - num? valueChange, - }) : valueChange = valueChange ?? 1.25; - - @override - ConsumerState createState() => _LogsWeightWidgetState(); -} - -class _LogsWeightWidgetState extends ConsumerState { - final _logger = Logger('LogsWeightWidget'); - late TextEditingController _controller; - num? _lastWeight; - - @override - void initState() { - super.initState(); - _controller = widget.controller ?? TextEditingController(); - } - - @override - void dispose() { - if (widget.controller == null) { - _controller.dispose(); - } - super.dispose(); - } - - @override - Widget build(BuildContext context) { - final numberFormat = NumberFormat.decimalPattern(Localizations.localeOf(context).toString()); - final i18n = AppLocalizations.of(context); - - final plateProvider = ref.read(plateCalculatorProvider.notifier); - final logProvider = ref.read(gymLogProvider.notifier); - final log = ref.watch(gymLogProvider); - final currentWeight = log?.weight; - - // Only update when provider value changed - if (currentWeight != _lastWeight) { - WidgetsBinding.instance.addPostFrameCallback((_) { - if (!mounted) { - return; - } - if (currentWeight != null) { - _controller.text = numberFormat.format(currentWeight); - } else { - _controller.clear(); - } - _lastWeight = currentWeight; - }); - } - - return Row( - children: [ - IconButton( - // "Quick-remove" button - icon: const Icon(Icons.remove, color: Colors.black), - onPressed: () { - final base = currentWeight ?? 0; - final newValue = base - widget.valueChange; - if (newValue >= 0 && log != null) { - logProvider.setWeight(newValue); - } - }, - ), - - // Text field - Expanded( - child: TextFormField( - controller: _controller, - decoration: InputDecoration(labelText: i18n.weight), - keyboardType: textInputTypeDecimal, - onChanged: (value) { - try { - final newValue = numberFormat.parse(value); - plateProvider.setWeight(newValue); - logProvider.setWeight(newValue); - } on FormatException catch (error) { - _logger.finer('Error parsing weight: $error'); - } - }, - onSaved: (newValue) { - if (newValue == null || log == null) { - return; - } - logProvider.setWeight(numberFormat.parse(newValue)); - }, - validator: (value) { - if (numberFormat.tryParse(value ?? '') == null) { - return i18n.enterValidNumber; - } - return null; - }, - ), - ), - - // "Quick-add" button - IconButton( - icon: const Icon(Icons.add, color: Colors.black), - onPressed: () { - final base = currentWeight ?? 0; - final newValue = base + widget.valueChange; - if (log != null) { - logProvider.setWeight(newValue); - } - }, - ), - ], - ); - } -} - class LogsPastLogsWidget extends ConsumerWidget { final List pastLogs; @@ -487,177 +244,3 @@ class LogsPastLogsWidget extends ConsumerWidget { ); } } - -class LogFormWidget extends ConsumerStatefulWidget { - final PageController controller; - final SetConfigData configData; - - const LogFormWidget({ - super.key, - required this.controller, - required this.configData, - }); - - @override - _LogFormWidgetState createState() => _LogFormWidgetState(); -} - -class _LogFormWidgetState extends ConsumerState { - final _form = GlobalKey(); - var _detailed = false; - bool _isSaving = false; - - @override - Widget build(BuildContext context) { - final i18n = AppLocalizations.of(context); - final log = ref.watch(gymLogProvider); - - return Form( - key: _form, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - i18n.newEntry, - style: Theme.of(context).textTheme.titleLarge, - textAlign: TextAlign.center, - ), - if (!_detailed) - Row( - children: [ - Flexible( - child: LogsRepsWidget( - key: const ValueKey('logs-reps-widget'), - valueChange: widget.configData.repetitionsRounding, - ), - ), - const SizedBox(width: 8), - Flexible( - child: LogsWeightWidget( - key: const ValueKey('logs-weight-widget'), - valueChange: widget.configData.weightRounding, - ), - ), - ], - ), - if (_detailed) - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Flexible( - child: LogsRepsWidget( - key: const ValueKey('logs-reps-widget'), - valueChange: widget.configData.repetitionsRounding, - ), - ), - const SizedBox(width: 8), - Flexible( - child: RepetitionUnitInputWidget( - key: const ValueKey('repetition-unit-input-widget'), - log!.repetitionsUnitObj, - onChanged: (v) => ref.read(gymLogProvider.notifier).setRepetitionUnit(v), - ), - ), - const SizedBox(width: 8), - ], - ), - if (_detailed) - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Flexible( - child: LogsWeightWidget( - key: const ValueKey('logs-weight-widget'), - valueChange: widget.configData.weightRounding, - ), - ), - const SizedBox(width: 8), - Flexible( - child: WeightUnitInputWidget( - log!.weightUnitObj, - onChanged: (v) => ref.read(gymLogProvider.notifier).setWeightUnit(v), - key: const ValueKey('weight-unit-input-widget'), - ), - ), - const SizedBox(width: 8), - ], - ), - if (_detailed) - RiRInputWidget( - key: const ValueKey('rir-input-widget'), - log!.rir, - onChanged: (value) { - log.rir = value == '' ? null : num.parse(value); - }, - ), - SwitchListTile( - key: const ValueKey('units-switch'), - dense: true, - title: Text(i18n.setUnitsAndRir), - value: _detailed, - onChanged: (value) { - setState(() { - _detailed = !_detailed; - }); - }, - ), - FilledButton( - key: const ValueKey('save-log-button'), - onPressed: _isSaving - ? null - : () async { - final isValid = _form.currentState!.validate(); - if (!isValid) { - return; - } - _isSaving = true; - _form.currentState!.save(); - - try { - final gymState = ref.read(gymStateProvider); - final gymProvider = ref.read(gymStateProvider.notifier); - - final logToSave = ref.read(gymLogProvider); - await provider.Provider.of( - context, - listen: false, - ).addLog(logToSave!); - final page = gymState.getSlotEntryPageByIndex()!; - gymProvider.markSlotPageAsDone(page.uuid, isDone: true); - - if (mounted) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - duration: const Duration(seconds: 2), - content: Text( - i18n.successfullySaved, - textAlign: TextAlign.center, - ), - ), - ); - } - widget.controller.nextPage( - duration: DEFAULT_ANIMATION_DURATION, - curve: DEFAULT_ANIMATION_CURVE, - ); - setState(() { - _isSaving = false; - }); - } on WgerHttpException { - setState(() { - _isSaving = false; - }); - rethrow; - } finally { - setState(() { - _isSaving = false; - }); - } - }, - child: _isSaving ? const FormProgressIndicator() : Text(i18n.save), - ), - ], - ), - ); - } -} diff --git a/test/routine/gym_mode/gym_mode_test.dart b/test/routine/gym_mode/gym_mode_test.dart index 3f61e88b2..685873163 100644 --- a/test/routine/gym_mode/gym_mode_test.dart +++ b/test/routine/gym_mode/gym_mode_test.dart @@ -31,9 +31,9 @@ import 'package:wger/providers/exercises.dart'; import 'package:wger/providers/routines.dart'; import 'package:wger/screens/gym_mode.dart'; import 'package:wger/screens/routine_screen.dart'; -import 'package:wger/widgets/routines/forms/reps_unit.dart'; +import 'package:wger/widgets/routines/forms/repetitions.dart'; import 'package:wger/widgets/routines/forms/rir.dart'; -import 'package:wger/widgets/routines/forms/weight_unit.dart'; +import 'package:wger/widgets/routines/forms/weight.dart'; import 'package:wger/widgets/routines/gym_mode/exercise_overview.dart'; import 'package:wger/widgets/routines/gym_mode/log_page.dart'; import 'package:wger/widgets/routines/gym_mode/session_page.dart'; diff --git a/test/routine/repetition_unit_form_widget_test.dart b/test/routine/repetition_unit_form_widget_test.dart index 43cb66f3e..9eab12390 100644 --- a/test/routine/repetition_unit_form_widget_test.dart +++ b/test/routine/repetition_unit_form_widget_test.dart @@ -26,7 +26,7 @@ import 'package:wger/models/workouts/repetition_unit.dart'; import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/providers/routines.dart'; import 'package:wger/screens/routine_screen.dart'; -import 'package:wger/widgets/routines/forms/reps_unit.dart'; +import 'package:wger/widgets/routines/forms/repetitions.dart'; import 'repetition_unit_form_widget_test.mocks.dart'; diff --git a/test/routine/slot_entry_form_test.dart b/test/routine/slot_entry_form_test.dart index 81ec22a24..8a4784f6f 100644 --- a/test/routine/slot_entry_form_test.dart +++ b/test/routine/slot_entry_form_test.dart @@ -1,13 +1,13 @@ /* * This file is part of wger Workout Manager . - * Copyright (C) 2020, 2021 wger Team + * Copyright (c) 2026 wger Team * * wger Workout Manager is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * - * wger Workout Manager is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. @@ -25,10 +25,10 @@ import 'package:wger/helpers/consts.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/providers/routines.dart'; -import 'package:wger/widgets/routines/forms/reps_unit.dart'; +import 'package:wger/widgets/routines/forms/repetitions.dart'; import 'package:wger/widgets/routines/forms/rir.dart'; import 'package:wger/widgets/routines/forms/slot_entry.dart'; -import 'package:wger/widgets/routines/forms/weight_unit.dart'; +import 'package:wger/widgets/routines/forms/weight.dart'; import '../../test_data/routines.dart'; import './slot_entry_form_test.mocks.dart'; diff --git a/test/routine/weight_unit_form_widget_test.dart b/test/routine/weight_unit_form_widget_test.dart index 1c489c55e..b1a07dc6f 100644 --- a/test/routine/weight_unit_form_widget_test.dart +++ b/test/routine/weight_unit_form_widget_test.dart @@ -26,7 +26,7 @@ import 'package:wger/models/workouts/slot_entry.dart'; import 'package:wger/models/workouts/weight_unit.dart'; import 'package:wger/providers/routines.dart'; import 'package:wger/screens/routine_screen.dart'; -import 'package:wger/widgets/routines/forms/weight_unit.dart'; +import 'package:wger/widgets/routines/forms/weight.dart'; import 'weight_unit_form_widget_test.mocks.dart'; From f5bb18747e909437b4a157bc9096c7270e3480ca Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 20 Feb 2026 12:02:13 +0100 Subject: [PATCH 4/9] Bump dependencies --- Gemfile.lock | 60 +++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d38cd4710..fb27ec6d1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,8 +8,8 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.4.0) - aws-partitions (1.1210.0) - aws-sdk-core (3.241.4) + aws-partitions (1.1216.0) + aws-sdk-core (3.242.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) @@ -17,7 +17,7 @@ GEM bigdecimal jmespath (~> 1, >= 1.6.1) logger - aws-sdk-kms (1.121.0) + aws-sdk-kms (1.122.0) aws-sdk-core (~> 3, >= 3.241.4) aws-sigv4 (~> 1.5) aws-sdk-s3 (1.213.0) @@ -43,7 +43,7 @@ GEM dotenv (2.8.1) emoji_regex (3.2.3) excon (0.112.0) - faraday (1.10.4) + faraday (1.10.5) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -72,12 +72,12 @@ GEM faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.4.0) - fastlane (2.231.1) + fastlane (2.232.1) CFPropertyList (>= 2.3, < 4.0.0) abbrev (~> 0.1.2) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) - aws-sdk-s3 (~> 1.0) + aws-sdk-s3 (~> 1.197) babosa (>= 1.0.3, < 2.0.0) base64 (~> 0.2.0) benchmark (>= 0.1.0) @@ -96,7 +96,7 @@ GEM gh_inspector (>= 1.1.2, < 2.0.0) google-apis-androidpublisher_v3 (~> 0.3) google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-env (>= 1.6.0, < 2.0.0) + google-cloud-env (>= 1.6.0, <= 2.1.1) google-cloud-storage (~> 1.31) highline (~> 2.0) http-cookie (~> 1.0.5) @@ -126,38 +126,40 @@ GEM fastlane-sirp (1.0.0) sysrandom (~> 1.0) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.54.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.3) + google-apis-androidpublisher_v3 (0.96.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-core (0.18.0) addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) + googleauth (~> 1.9) + httpclient (>= 2.8.3, < 3.a) mini_mime (~> 1.0) + mutex_m representable (~> 3.0) retriable (>= 2.0, < 4.a) - rexml - google-apis-iamcredentials_v1 (0.17.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-playcustomapp_v1 (0.13.0) - google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.31.0) - google-apis-core (>= 0.11.0, < 2.a) + google-apis-iamcredentials_v1 (0.26.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-playcustomapp_v1 (0.17.0) + google-apis-core (>= 0.15.0, < 2.a) + google-apis-storage_v1 (0.60.0) + google-apis-core (>= 0.15.0, < 2.a) google-cloud-core (1.8.0) google-cloud-env (>= 1.0, < 3.a) google-cloud-errors (~> 1.0) - google-cloud-env (1.6.0) - faraday (>= 0.17.3, < 3.0) + google-cloud-env (2.1.1) + faraday (>= 1.0, < 3.a) google-cloud-errors (1.5.0) - google-cloud-storage (1.47.0) + google-cloud-storage (1.58.0) addressable (~> 2.8) digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.31.0) + google-apis-core (>= 0.18, < 2) + google-apis-iamcredentials_v1 (~> 0.18) + google-apis-storage_v1 (>= 0.42) google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) + googleauth (~> 1.9) mini_mime (~> 1.0) - googleauth (1.8.1) - faraday (>= 0.17.3, < 3.a) + googleauth (1.11.2) + faraday (>= 1.0, < 3.a) + google-cloud-env (~> 2.1) jwt (>= 1.4, < 3.0) multi_json (~> 1.11) os (>= 0.9, < 2.0) @@ -168,7 +170,7 @@ GEM httpclient (2.9.0) mutex_m jmespath (1.6.2) - json (2.18.0) + json (2.18.1) jwt (2.10.2) base64 logger (1.7.0) @@ -190,7 +192,7 @@ GEM declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) - retriable (3.1.2) + retriable (3.2.1) rexml (3.4.4) rouge (3.28.0) ruby2_keywords (0.0.5) From d4976a105db718298209c17bb12219fe9157f06b Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 20 Feb 2026 12:02:56 +0100 Subject: [PATCH 5/9] Upgrade dependencies --- macos/Flutter/GeneratedPluginRegistrant.swift | 2 - pubspec.lock | 132 +++++++++++------- 2 files changed, 82 insertions(+), 52 deletions(-) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index e5d0d3081..06cb02d8d 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,7 +7,6 @@ import Foundation import file_selector_macos import package_info_plus -import path_provider_foundation import rive_common import shared_preferences_foundation import sqlite3_flutter_libs @@ -17,7 +16,6 @@ import video_player_avfoundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) RivePlugin.register(with: registry.registrar(forPlugin: "RivePlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin")) diff --git a/pubspec.lock b/pubspec.lock index 51512a1a2..ab517cdbc 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -29,10 +29,10 @@ packages: dependency: transitive description: name: archive - sha256: "2fde1607386ab523f7a36bb3e7edb43bd58e6edaf2ffb29d8a6d578b297fdbbd" + sha256: a96e8b390886ee8abb49b7bd3ac8df6f451c621619f52a26e815fdcf568959ff url: "https://pub.dev" source: hosted - version: "4.0.7" + version: "4.0.9" args: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: ac78098de97893812b7aff1154f29008fa2464cad9e8e7044d39bc905dad4fbc + sha256: "39ad4ca8a2876779737c60e4228b4bcd35d4352ef7e14e47514093edc012c734" url: "https://pub.dev" source: hosted - version: "2.11.0" + version: "2.11.1" built_collection: dependency: transitive description: @@ -101,34 +101,34 @@ packages: dependency: transitive description: name: built_value - sha256: "120df83d4a4ce6bed06ad653c0a3e85737e0f66664f31e17a55136ff5a738cde" + sha256: "7931c90b84bc573fef103548e354258ae4c9d28d140e41961df6843c5d60d4d8" url: "https://pub.dev" source: hosted - version: "8.12.2" + version: "8.12.3" camera: dependency: transitive description: name: camera - sha256: eefad89f262a873f38d21e5eec853461737ea074d7c9ede39f3ceb135d201cab + sha256: "4142a19a38e388d3bab444227636610ba88982e36dff4552d5191a86f65dc437" url: "https://pub.dev" source: hosted - version: "0.11.3" + version: "0.11.4" camera_android_camerax: dependency: transitive description: name: camera_android_camerax - sha256: bc7a96998258adddd0b653dd693b0874537707d58b0489708f2a646e4f124246 + sha256: "8516fe308bc341a5067fb1a48edff0ddfa57c0d3cdcc9dbe7ceca3ba119e2577" url: "https://pub.dev" source: hosted - version: "0.6.27" + version: "0.6.30" camera_avfoundation: dependency: transitive description: name: camera_avfoundation - sha256: "087a9fadef20325cb246b4c13344a3ce8e408acfc3e0c665ebff0ec3144d7163" + sha256: "11b4aee2f5e5e038982e152b4a342c749b414aa27857899d20f4323e94cb5f0b" url: "https://pub.dev" source: hosted - version: "0.9.22+8" + version: "0.9.23+2" camera_platform_interface: dependency: transitive description: @@ -189,10 +189,10 @@ packages: dependency: "direct dev" description: name: cider - sha256: "455e3549bd1d21708326985702703345245acd3d7a2ac485de4183affb414a2c" + sha256: "27b9cd9526c70d6cd47299cd644cddaac8102e5f9783ef4bb440840743271883" url: "https://pub.dev" source: hosted - version: "0.2.9" + version: "0.2.10" cli_config: dependency: transitive description: @@ -217,6 +217,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: "83ccdaa064c980b5596c35dd64a8d3ecc68620174ab9b90b6343b753aa721687" + url: "https://pub.dev" + source: hosted + version: "1.0.0" code_builder: dependency: transitive description: @@ -253,10 +261,10 @@ packages: dependency: transitive description: name: cross_file - sha256: "701dcfc06da0882883a2657c445103380e53e647060ad8d9dfb710c100996608" + sha256: "28bb3ae56f117b5aec029d702a90f57d285cd975c3c5c281eaca38dbc47c5937" url: "https://pub.dev" source: hosted - version: "0.3.5+1" + version: "0.3.5+2" crypto: dependency: transitive description: @@ -325,10 +333,10 @@ packages: dependency: transitive description: name: ffi - sha256: d07d37192dbf97461359c1518788f203b0c9102cfd2c35a716b823741219542c + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.2.0" file: dependency: transitive description: @@ -607,6 +615,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + hooks: + dependency: transitive + description: + name: hooks + sha256: "7a08a0d684cb3b8fb604b78455d5d352f502b68079f7b80b831c62220ab0a4f6" + url: "https://pub.dev" + source: hosted + version: "1.0.1" html: dependency: transitive description: @@ -643,10 +659,10 @@ packages: dependency: transitive description: name: image - sha256: "492bd52f6c4fbb6ee41f781ff27765ce5f627910e1e0cbecfa3d9add5562604c" + sha256: f9881ff4998044947ec38d098bc7c8316ae1186fa786eddffdb867b9bc94dfce url: "https://pub.dev" source: hosted - version: "4.7.2" + version: "4.8.0" image_picker: dependency: "direct main" description: @@ -659,10 +675,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "5e9bf126c37c117cf8094215373c6d561117a3cfb50ebc5add1a61dc6e224677" + sha256: "518a16108529fc18657a3e6dde4a043dc465d16596d20ab2abd49a4cac2e703d" url: "https://pub.dev" source: hosted - version: "0.8.13+10" + version: "0.8.13+13" image_picker_for_web: dependency: transitive description: @@ -675,10 +691,10 @@ packages: dependency: transitive description: name: image_picker_ios - sha256: "956c16a42c0c708f914021666ffcd8265dde36e673c9fa68c81f7d085d9774ad" + sha256: b9c4a438a9ff4f60808c9cf0039b93a42bb6c2211ef6ebb647394b2b3fa84588 url: "https://pub.dev" source: hosted - version: "0.8.13+3" + version: "0.8.13+6" image_picker_linux: dependency: transitive description: @@ -784,10 +800,10 @@ packages: dependency: transitive description: name: lints - sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0 + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" url: "https://pub.dev" source: hosted - version: "6.0.0" + version: "6.1.0" list_counter: dependency: transitive description: @@ -868,6 +884,14 @@ packages: url: "https://pub.dev" source: hosted version: "4.1.3" + native_toolchain_c: + dependency: transitive + description: + name: native_toolchain_c + sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac" + url: "https://pub.dev" + source: hosted + version: "0.17.4" nested: dependency: transitive description: @@ -892,6 +916,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.2" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: "100a1c87616ab6ed41ec263b083c0ef3261ee6cd1dc3b0f35f8ddfa4f996fe52" + url: "https://pub.dev" + source: hosted + version: "9.3.0" package_config: dependency: transitive description: @@ -952,10 +984,10 @@ packages: dependency: transitive description: name: path_provider_foundation - sha256: "6d13aece7b3f5c5a9731eaf553ff9dcbc2eff41087fd2df587fd0fed9a3eb0c4" + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" url: "https://pub.dev" source: hosted - version: "2.5.1" + version: "2.6.0" path_provider_linux: dependency: transitive description: @@ -984,10 +1016,10 @@ packages: dependency: transitive description: name: petitparser - sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1" + sha256: "91bd59303e9f769f108f8df05e371341b15d59e995e6806aefab827b58336675" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "7.0.2" platform: dependency: transitive description: @@ -1160,10 +1192,10 @@ packages: dependency: transitive description: name: shared_preferences_android - sha256: "83af5c682796c0f7719c2bbf74792d113e40ae97981b8f266fa84574573556bc" + sha256: cbc40be9be1c5af4dab4d6e0de4d5d3729e6f3d65b89d21e1815d57705644a6f url: "https://pub.dev" source: hosted - version: "2.4.18" + version: "2.4.20" shared_preferences_foundation: dependency: transitive description: @@ -1253,10 +1285,10 @@ packages: dependency: transitive description: name: source_gen - sha256: "07b277b67e0096c45196cbddddf2d8c6ffc49342e88bf31d460ce04605ddac75" + sha256: "1d562a3c1f713904ebbed50d2760217fd8a51ca170ac4b05b0db490699dbac17" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.2.0" source_helper: dependency: transitive description: @@ -1285,10 +1317,10 @@ packages: dependency: transitive description: name: source_span - sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" url: "https://pub.dev" source: hosted - version: "1.10.1" + version: "1.10.2" sqlite3: dependency: transitive description: @@ -1429,10 +1461,10 @@ packages: dependency: transitive description: name: url_launcher_ios - sha256: cfde38aa257dae62ffe79c87fab20165dfdf6988c1d31b58ebf59b9106062aad + sha256: "580fe5dfb51671ae38191d316e027f6b76272b026370708c2d898799750a02b0" url: "https://pub.dev" source: hosted - version: "6.3.6" + version: "6.4.1" url_launcher_linux: dependency: transitive description: @@ -1461,10 +1493,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" + sha256: d0412fcf4c6b31ecfdb7762359b7206ffba3bbffd396c6d9f9c4616ece476c1f url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.2" url_launcher_windows: dependency: transitive description: @@ -1493,10 +1525,10 @@ packages: dependency: transitive description: name: vector_graphics_compiler - sha256: d354a7ec6931e6047785f4db12a1f61ec3d43b207fc0790f863818543f8ff0dc + sha256: "5a88dd14c0954a5398af544651c7fb51b457a2a556949bfb25369b210ef73a74" url: "https://pub.dev" source: hosted - version: "1.1.19" + version: "1.2.0" vector_math: dependency: transitive description: @@ -1525,26 +1557,26 @@ packages: dependency: "direct main" description: name: video_player - sha256: "096bc28ce10d131be80dfb00c223024eb0fba301315a406728ab43dd99c45bdf" + sha256: "08bfba72e311d48219acad4e191b1f9c27ff8cf928f2c7234874592d9c9d7341" url: "https://pub.dev" source: hosted - version: "2.10.1" + version: "2.11.0" video_player_android: dependency: transitive description: name: video_player_android - sha256: ee4fd520b0cafa02e4a867a0f882092e727cdaa1a2d24762171e787f8a502b0a + sha256: "9862c67c4661c98f30fe707bc1a4f97d6a0faa76784f485d282668e4651a7ac3" url: "https://pub.dev" source: hosted - version: "2.9.1" + version: "2.9.4" video_player_avfoundation: dependency: transitive description: name: video_player_avfoundation - sha256: d1eb970495a76abb35e5fa93ee3c58bd76fb6839e2ddf2fbb636674f2b971dd4 + sha256: f93b93a3baa12ca0ff7d00ca8bc60c1ecd96865568a01ff0c18a99853ee201a5 url: "https://pub.dev" source: hosted - version: "2.8.9" + version: "2.9.3" video_player_platform_interface: dependency: transitive description: @@ -1650,5 +1682,5 @@ packages: source: hosted version: "3.1.3" sdks: - dart: ">=3.9.0 <4.0.0" - flutter: ">=3.38.0" + dart: ">=3.10.3 <4.0.0" + flutter: ">=3.38.4" From 06e24ba38789450ec9de318cf671047036b2f7dc Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 20 Feb 2026 12:03:47 +0100 Subject: [PATCH 6/9] Remove duplicated import --- lib/providers/base_provider.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/providers/base_provider.dart b/lib/providers/base_provider.dart index e13cd847e..2abb48477 100644 --- a/lib/providers/base_provider.dart +++ b/lib/providers/base_provider.dart @@ -22,7 +22,6 @@ import 'dart:io'; import 'dart:math' as math; import 'package:http/http.dart' as http; -import 'package:http/http.dart'; import 'package:logging/logging.dart'; import 'package:wger/core/exceptions/http_exception.dart'; import 'package:wger/providers/auth.dart'; @@ -177,7 +176,7 @@ class WgerBaseProvider { } /// DELETEs an existing object - Future deleteRequest(String url, int id) async { + Future deleteRequest(String url, int id) async { final deleteUrl = makeUrl(url, id: id); final response = await client.delete( From 7ec5fe1027e7429b78e120d27ac25c6deff68974 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 20 Feb 2026 16:31:24 +0100 Subject: [PATCH 7/9] Also send the platform as the user agent This will allow us to see which clients are more common --- lib/providers/auth.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/providers/auth.dart b/lib/providers/auth.dart index 3f2e26fa8..6bbcb044d 100644 --- a/lib/providers/auth.dart +++ b/lib/providers/auth.dart @@ -298,7 +298,8 @@ class AuthProvider with ChangeNotifier { out = '/${applicationVersion!.version} ' '(${applicationVersion!.packageName}; ' - 'build: ${applicationVersion!.buildNumber})' + 'build: ${applicationVersion!.buildNumber}; ' + 'platform: ${Platform.operatingSystem})' ' - https://github.com/wger-project'; } return 'wger App$out'; From 9140838ac79cfc3afb3a4966f6c2a9f5b93a75ec Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Fri, 20 Feb 2026 16:31:32 +0100 Subject: [PATCH 8/9] Update Podfile.lock --- ios/Podfile.lock | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 73af7e23b..6268607cc 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -12,9 +12,6 @@ PODS: - Flutter - package_info_plus (0.4.5): - Flutter - - path_provider_foundation (0.0.1): - - Flutter - - FlutterMacOS - pointer_interceptor_ios (0.0.1): - Flutter - rive_common (0.0.1): @@ -61,7 +58,6 @@ DEPENDENCIES: - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - integration_test (from `.symlinks/plugins/integration_test/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - pointer_interceptor_ios (from `.symlinks/plugins/pointer_interceptor_ios/ios`) - rive_common (from `.symlinks/plugins/rive_common/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) @@ -88,8 +84,6 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/integration_test/ios" package_info_plus: :path: ".symlinks/plugins/package_info_plus/ios" - path_provider_foundation: - :path: ".symlinks/plugins/path_provider_foundation/darwin" pointer_interceptor_ios: :path: ".symlinks/plugins/pointer_interceptor_ios/ios" rive_common: @@ -111,7 +105,6 @@ SPEC CHECKSUMS: image_picker_ios: e0ece4aa2a75771a7de3fa735d26d90817041326 integration_test: 4a889634ef21a45d28d50d622cf412dc6d9f586e package_info_plus: af8e2ca6888548050f16fa2f1938db7b5a5df499 - path_provider_foundation: bb55f6dbba17d0dccd6737fe6f7f34fbd0376880 pointer_interceptor_ios: da06a662d5bfd329602b45b2ab41bc0fb5fdb0f0 rive_common: dd421daaf9ae69f0125aa761dd96abd278399952 shared_preferences_foundation: 7036424c3d8ec98dfe75ff1667cb0cd531ec82bb From 1462ab1319b05a2a6489e3fb3038dea1d7d296d9 Mon Sep 17 00:00:00 2001 From: Roland Geider Date: Sat, 21 Feb 2026 00:37:27 +0100 Subject: [PATCH 9/9] Update pull request template --- .github/pull_request_template.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 5d11748ca..d7003cd2e 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,3 +1,7 @@ + + + + # Proposed Changes - @@ -5,13 +9,10 @@ ## Related Issue(s) -If applicable, please link to any related issues (`Closes #123`, -`Closes wger-project/other-repo#123`, `See also #123`, etc.) + + ## Please check that the PR fulfills these requirements - [ ] Tests for the changes have been added (for bug fixes / features) -- [ ] Set a 100 character limit in your editor/IDE to avoid white space diffs in the PR - (run `dart format .`) -- [ ] Updated/added relevant documentation (doc comments with `///`). -- [ ] Added relevant reviewers. +- [ ] Set a 100-character limit to avoid white space diffs (run `dart format .`)