mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-30 01:41:05 +01:00
fix(nutrition): decouple MealEditingToolbar visibility from ViewMode
- revert translation changes in charts and cleanup meal logs - fix for the Meal test
This commit is contained in:
@@ -337,7 +337,6 @@ class NutritionalDiaryChartWidgetFlState extends State<NutritionalDiaryChartWidg
|
||||
final logged7DayAvg = widget._nutritionalPlan.loggedNutritionalValues7DayAvg;
|
||||
|
||||
final [colorPlanned, colorLoggedToday, colorLogged7Day] = LIST_OF_COLORS3;
|
||||
final i18n = AppLocalizations.of(context);
|
||||
|
||||
BarChartGroupData barchartGroup(
|
||||
int x,
|
||||
@@ -434,18 +433,18 @@ class NutritionalDiaryChartWidgetFlState extends State<NutritionalDiaryChartWidg
|
||||
borderData: FlBorderData(show: false),
|
||||
groupsSpace: 30,
|
||||
barGroups: [
|
||||
barchartGroup(0, barsSpace, barsWidth, i18n.protein),
|
||||
barchartGroup(1, barsSpace, barsWidth, i18n.carbohydrates),
|
||||
barchartGroup(0, barsSpace, barsWidth, 'protein'),
|
||||
barchartGroup(1, barsSpace, barsWidth, 'carbohydrates'),
|
||||
barchartGroup(
|
||||
2,
|
||||
barsSpace,
|
||||
barsWidth,
|
||||
i18n.carbohydratesSugar,
|
||||
'carbohydratesSugar',
|
||||
),
|
||||
barchartGroup(3, barsSpace, barsWidth, i18n.fat),
|
||||
barchartGroup(4, barsSpace, barsWidth, i18n.saturatedFat),
|
||||
barchartGroup(3, barsSpace, barsWidth, 'fat'),
|
||||
barchartGroup(4, barsSpace, barsWidth, 'fatSaturated'),
|
||||
if (widget._nutritionalPlan.nutritionalGoals.fiber != null)
|
||||
barchartGroup(5, barsSpace, barsWidth, i18n.fiber),
|
||||
barchartGroup(5, barsSpace, barsWidth, 'fiber'),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -304,12 +304,11 @@ class MealIngredientsSection extends ConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return Column(
|
||||
children: [
|
||||
if (editing)
|
||||
MealEditingToolbar(
|
||||
meal: meal,
|
||||
),
|
||||
if (showIngredientsDetails(viewMode)) ...[
|
||||
if (editing)
|
||||
MealEditingToolbar(
|
||||
meal: meal,
|
||||
),
|
||||
|
||||
const Divider(),
|
||||
const DiaryheaderTile(),
|
||||
_buildIngredientList(context),
|
||||
|
||||
@@ -71,11 +71,6 @@ void main() {
|
||||
await tester.tap(find.byIcon(Icons.edit));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
// Reveal the ingredients section by entering details view mode.
|
||||
// The toolbar is hidden in ViewMode.base, so we must toggle it.
|
||||
await tester.tap(find.byIcon(Icons.info_outline));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
final addButton = tester.widget<TextButton>(
|
||||
find.ancestor(
|
||||
of: find.byIcon(Icons.add),
|
||||
|
||||
Reference in New Issue
Block a user