Skip to content

Conversation

@dhituval
Copy link

Proposed Changes

Related Issue(s)

Fixes #852
#852

Fixes #852

Summary

This PR implements the ability for users to hide the Nutrition section from the Dashboard.

Motivation

Issue #852 requests adding a user preference to hide the diet plan / nutrition widget, allowing a more streamlined dashboard for users who do not track nutrition through the app.

Changes

  • Added hideNutrition to UserProvider, persisted via SharedPreferencesAsync
  • Added _loadHideNutrition() and setHideNutrition() for preference loading and saving
  • Updated DashboardScreen to conditionally render DashboardNutritionWidget
  • Added a settings toggle in SettingsPage so users can enable/disable the Nutrition display
  • Verified that setting persists through app restarts

Testing

  • Toggled setting in SettingsPage and verified UI updated immediately
  • Restarted the app to confirm persistence
  • Tested behavior on iOS simulator (iPhone 15)
Screenshot 2025-11-19 at 2 29 36 PM Screenshot 2025-11-19 at 2 29 51 PM

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

  • [ x] Tests for the changes have been added (for bug fixes / features)
  • [ x] Set a 100 character limit in your editor/IDE to avoid white space diffs in the PR
    (run dart format .)
  • [x ] Updated/added relevant documentation (doc comments with ///).
  • [ x] Added relevant reviewers.

@rolandgeider
Copy link
Member

Hi and thanks for the PR!

I would say that we should be a bit more flexible and allow the users to hide / show other widgets in the home screen (they might want to hide the routines, but not the diet plan). We could save in the prefs a map with the visibility state of the different widgets?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hide diet plan in home, if not used

2 participants