feat(routines): allow custom bar weight in plate calculator#1238
Open
bhavit04 wants to merge 1 commit into
Open
feat(routines): allow custom bar weight in plate calculator#1238bhavit04 wants to merge 1 commit into
bhavit04 wants to merge 1 commit into
Conversation
The bar weight in the plate calculator settings could previously only be set to one of a few preset values from a dropdown (e.g. 10/15/20 kg), which made common bars like 7.5 kg impossible to configure. Replace the dropdown with an editable, locale-aware numeric field so any positive value can be entered, while keeping the previous presets as quick-select chips. Invalid input is rejected with an inline error and the last valid value is retained. Closes wger-project#1131 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #1131
In the plate calculator settings the bar weight could only be chosen from a small dropdown of preset values (e.g.
10/15/20kg). This made it impossible to configure common bars such as a7.5kg technique/training bar.This PR replaces the dropdown with an editable numeric field so any positive value can be entered, while keeping the previous presets available as quick-select chips:
NumberFormat.decimalPattern), consistent with the other weight inputs in the app.barWeightlabel andenterValidNumbermessage.Testing
test/widgets/routines/plate_calculator_test.dartto cover both selecting a preset chip and typing a custom value (7.5).flutter analyzeclean; all plate-calculator tests pass.🤖 Generated with Claude Code