Skip to content

Fix onboarding weight validation text and negative profile values#303

Open
LarytheLord wants to merge 2 commits intosimonoppowa:developfrom
LarytheLord:fix/signup-weight-validation-288
Open

Fix onboarding weight validation text and negative profile values#303
LarytheLord wants to merge 2 commits intosimonoppowa:developfrom
LarytheLord:fix/signup-weight-validation-288

Conversation

@LarytheLord
Copy link
Copy Markdown

Summary

Fixes the onboarding weight validation message and prevents negative values in profile height/weight pickers.

Closes #288
Closes #216
Closes #217

Changes

  • onboarding_second_page_body.dart
    • Fixed validateWeight() to return onboardingWrongWeightLabel instead of onboardingWrongHeightLabel.
  • set_height_dialog.dart
    • Added lower-bound clamping for picker minimum value (>= 1) so users cannot scroll into negative heights.
    • Added confirmation-time guard to ensure returned value respects the same lower bound.
  • set_weight_dialog.dart
    • Added lower-bound clamping for picker minimum value (>= 1) so users cannot scroll into negative weights.
    • Added confirmation-time guard to ensure returned value respects the same lower bound.

Notes

I could not run Flutter tests in this environment because flutter/dart are not installed here.

@LarytheLord
Copy link
Copy Markdown
Author

LarytheLord commented Mar 3, 2026

Pushed a technical follow-up in commit 2e9d76d to make this PR easier to maintain and safer.

  • extracted profile height/weight picker bound and clamp logic into a shared utility (profile_picker_bounds.dart)
  • updated both set-height and set-weight dialogs to use the shared functions
  • added focused unit tests covering min/max range behavior and lower-bound clamping (profile_picker_bounds_test.dart)

This keeps the original bug fixes intact while adding regression coverage for the boundary logic.

@LarytheLord LarytheLord changed the base branch from main to develop March 8, 2026 14:42
@LarytheLord LarytheLord force-pushed the fix/signup-weight-validation-288 branch from 2e9d76d to b67f9bc Compare March 12, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant