-
-
Notifications
You must be signed in to change notification settings - Fork 346
Feature: Add BMI Tile to Dashboard & BMI Calculation #1023
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
lib/models/user/profile.dart
Outdated
| this.weight, | ||
| }); | ||
| double calculateBmi({double? weightOverride}) { | ||
| // 1. Wir definieren, welches Gewicht wir nutzen (Override ODER Profil) |
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.
Kommentare auf Englisch bitte :)
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.
Okay, I did it. I hope it worked with the upload. I'm not really familiar with l10n yet.
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.
I've pushed another update based on testing:
- New UI Layout: Moved the current BMI stats below the chart. This gives the chart full width and prevents date labels from being cut off.
- Interactive Tooltip: Tapping a point on the chart now shows the exact BMI value and date in a tooltip.
- Dynamic Date Axis: The x-axis now smartly formats dates:
- Default:
dd.MM(e.g. 12.03) - If range > 365 days:
MM/yy(e.g. 03/25) to save space.
- Default:
The widget should now look consistent and be fully responsive.
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.
The settings_test.dart is failing because the mocks for SharedPreferences don't know about the new key 'show_bmi_dashboard' yet. Since I cannot easily regenerate the mocks without modifying the build setup, could you please advise or update the test mocks?
Proposed Changes
Profilemodel (fallback to 0 if weight/height missing).DashboardBmiWidget: A new tile displaying current BMI, category, and history chart.UserProviderto toggle the BMI tile visibility on the dashboard.DashboardScreen.DashboardWeightWidget(removed redundant switch).Related Issue(s)# Proposed Changes
Profilemodel (fallback to 0 if weight/height missing).DashboardBmiWidget: A new tile displaying current BMI, category, and history chart.UserProviderto toggle the BMI tile visibility on the dashboard.DashboardScreen.DashboardWeightWidget(removed redundant switch).Related Issue(s)
Closes #2132
Please check that the PR fulfills these requirements
///).Closes #2132
Please check that the PR fulfills these requirements
///).