mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-28 17:08:29 +01:00
Mirrors the React refactor in wger-project/react#1237 addressing Roland's review — the SwitchListTile + conditional Slider pair expressed one semantic decision ("what grade ceiling?") through two controls. Folded "Off" into the slider itself: - Slider stops are now Off | A | B | C | D | E (was A..E, gated by a SwitchListTile). - Off position sends no `nutriscoreMax`; A..E map as before. - Heading changed from "Filter by Nutri-Score" to "Nutri-Score filter", with a dynamic helper ("No filter" / "<grade> or better"). - Model: `IngredientFilters.nutriscoreMax` is now nullable; removed `filterNutriscore`. `copyWith` takes a `clearNutriscoreMax` flag because Dart's `??` cannot distinguish "no argument" from "null". - Storage collapsed: `saveIngredientNutriscoreMax(null)` removes the key; `getIngredientNutriscoreMax()` returns `null` when absent. - Riverpod notifier: removed `toggleNutriscore`; `chooseNutriscoreMax` now takes `NutriScore?`. - l10n: removed `filterNutriscoreMax`; added `filterNutriscoreOff`, `filterNutriscoreNoFilter`, `filterNutriscoreOrBetter` (placeholder). Tests updated: 61/61 pass.
flutter pub run build_runner build flutter pub run build_runner watch