Skip to content

Conversation

@elias170105
Copy link
Contributor

@elias170105 elias170105 commented Dec 3, 2025

Proposed Changes

  • Added BMI calculation logic to Profile model (fallback to 0 if weight/height missing).
  • Created DashboardBmiWidget: A new tile displaying current BMI, category, and history chart.
  • Added a setting in UserProvider to toggle the BMI tile visibility on the dashboard.
  • Integrated the BMI tile into DashboardScreen.
  • Cleaned up DashboardWeightWidget (removed redundant switch).

Related Issue(s)# Proposed Changes

  • Added BMI calculation logic to Profile model (fallback to 0 if weight/height missing).
  • Created DashboardBmiWidget: A new tile displaying current BMI, category, and history chart.
  • Added a setting in UserProvider to toggle the BMI tile visibility on the dashboard.
  • Integrated the BMI tile into DashboardScreen.
  • Cleaned up DashboardWeightWidget (removed redundant switch).

Related Issue(s)

Closes #2132

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
  • Updated/added relevant documentation (doc comments with ///).
  • Added relevant reviewers.

Closes #2132

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
  • Updated/added relevant documentation (doc comments with ///).
  • Added relevant reviewers.
this.weight,
});
double calculateBmi({double? weightOverride}) {
// 1. Wir definieren, welches Gewicht wir nutzen (Override ODER Profil)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kommentare auf Englisch bitte :)

Copy link
Contributor Author

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.

Copy link
Contributor Author

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:

  1. 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.
  2. Interactive Tooltip: Tapping a point on the chart now shows the exact BMI value and date in a tooltip.
  3. 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.

The widget should now look consistent and be fully responsive.

Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants