Abschnitt 10
This commit is contained in:
+17
-18
@@ -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),
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user