diff --git a/lib/android/components/food_list_component.dart b/lib/android/components/food_list_component.dart index fa0e4ee..cda9b35 100644 --- a/lib/android/components/food_list_component.dart +++ b/lib/android/components/food_list_component.dart @@ -14,14 +14,15 @@ class FoodComponent extends StatelessWidget { return ValueListenableBuilder( valueListenable: box.listenable(), builder: (context, box, widget) { + final mealTypes = ['FRÜHSTÜCK','MITTAGESSEN','ABENDESSEN']; // Specify the desired orde return ListView.builder( primary: false, shrinkWrap: true, itemCount: box.keys.length, itemBuilder: (context, i) { return CardComponent( - eatingMealName: box.keyAt(i).toString(), - selectedMeal: castDynamicToListFood(box.getAt(i)), + eatingMealName: mealTypes[i], + selectedMeal: castDynamicToListFood(box.get(mealTypes[i])), addButtonVisible: box.name != StatisticsService.instance.todayStatisticsBoxName.toLowerCase(), ); } diff --git a/lib/android/components/meals.dart b/lib/android/components/meals.dart index a0958e3..13cfcf0 100644 --- a/lib/android/components/meals.dart +++ b/lib/android/components/meals.dart @@ -16,12 +16,13 @@ class MealsComponent extends StatelessWidget { return ValueListenableBuilder( valueListenable: Hive.box(dotenv.env['MEALPLAN_BOX'] ?? 'MEALPLAN').listenable(), builder: (context, box, widget) { + final mealTypes = ['FRÜHSTÜCK','MITTAGESSEN','ABENDESSEN']; // Specify the desired order of meal types return ListView.builder( primary: false, shrinkWrap: true, itemCount: box.keys.length, itemBuilder: (context, i) { - String mealTypeAsString = box.keyAt(i).toString(); + String mealTypeAsString = mealTypes[i]; return CardComponent( mealTypeAsString, StatisticsService.instance.getMealsOfTodayByMealtype(mealTypeAsString),