This commit is contained in:
2024-03-15 14:24:42 +01:00
parent 09b9e725b0
commit ec74229bce
+23 -11
View File
@@ -33,7 +33,19 @@ class MealDetailsScreen extends ConsumerWidget {
),
);
},
icon: Icon(isFavorite ? Icons.star : Icons.star_border),
icon: AnimatedSwitcher(
transitionBuilder: (child, animation) {
return RotationTransition(
turns: Tween<double>(begin: 0.8, end: 1).animate(animation),
child: child,
);
},
duration: const Duration(milliseconds: 300),
child: Icon(
isFavorite ? Icons.star : Icons.star_border,
key: ValueKey(isFavorite),
),
),
)
]),
body: SingleChildScrollView(
@@ -49,25 +61,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 +92,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,
),
),
),
],