Abschnitt 10

This commit is contained in:
2024-03-12 15:29:57 +01:00
parent e37b77e024
commit eae46d7a80
6 changed files with 44 additions and 42 deletions
+17 -18
View File
@@ -1,10 +1,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_meals/providers/filters_provider.dart';
// import 'package:flutter_meals/screens/tabs.dart';
// import 'package:flutter_meals/widgets/main_drawer.dart';
import 'package:flutter_meals/providers/filters_provider.dart';
class FiltersScreen extends ConsumerWidget {
const FiltersScreen({super.key});
@@ -29,14 +28,14 @@ class FiltersScreen extends ConsumerWidget {
title: Text(
'Gluten-free',
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
subtitle: Text(
'Only include gluten-free meals.',
style: Theme.of(context).textTheme.labelMedium!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
activeColor: Theme.of(context).colorScheme.tertiary,
contentPadding: const EdgeInsets.only(left: 34, right: 22),
@@ -51,14 +50,14 @@ class FiltersScreen extends ConsumerWidget {
title: Text(
'Lactose-free',
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
subtitle: Text(
'Only include lactose-free meals.',
style: Theme.of(context).textTheme.labelMedium!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
activeColor: Theme.of(context).colorScheme.tertiary,
contentPadding: const EdgeInsets.only(left: 34, right: 22),
@@ -73,14 +72,14 @@ class FiltersScreen extends ConsumerWidget {
title: Text(
'Vegetarian',
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
subtitle: Text(
'Only include vegetarian meals.',
style: Theme.of(context).textTheme.labelMedium!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
activeColor: Theme.of(context).colorScheme.tertiary,
contentPadding: const EdgeInsets.only(left: 34, right: 22),
@@ -95,14 +94,14 @@ class FiltersScreen extends ConsumerWidget {
title: Text(
'Vegan',
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
subtitle: Text(
'Only include vegan meals.',
style: Theme.of(context).textTheme.labelMedium!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
activeColor: Theme.of(context).colorScheme.tertiary,
contentPadding: const EdgeInsets.only(left: 34, right: 22),
+10 -10
View File
@@ -49,25 +49,25 @@ class MealDetailsScreen extends ConsumerWidget {
Text(
'Ingredients',
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.bold,
),
color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 14),
for (final ingredient in meal.ingredients)
Text(
ingredient,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
const SizedBox(height: 24),
Text(
'Steps',
style: Theme.of(context).textTheme.titleLarge!.copyWith(
color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.bold,
),
color: Theme.of(context).colorScheme.primary,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 14),
for (final step in meal.steps)
@@ -80,8 +80,8 @@ class MealDetailsScreen extends ConsumerWidget {
step,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: Theme.of(context).colorScheme.onBackground,
),
color: Theme.of(context).colorScheme.onBackground,
),
),
),
],
+2 -3
View File
@@ -54,10 +54,9 @@ class _TabsScreenState extends ConsumerState<TabsScreen> {
var activePageTitle = 'Categories';
if (_selectedPageIndex == 1) {
final favoritesMeals = ref.watch(favoriteMealsProvider);
final favoriteMeals = ref.watch(favoriteMealsProvider);
activePage = MealsScreen(
meals: favoritesMeals,
meals: favoriteMeals,
);
activePageTitle = 'Your Favorites';
}