diff --git a/lib/screens/meal_details.dart b/lib/screens/meal_details.dart index 8f26b64..f189004 100644 --- a/lib/screens/meal_details.dart +++ b/lib/screens/meal_details.dart @@ -51,35 +51,38 @@ class MealDetailsScreen extends ConsumerWidget { body: SingleChildScrollView( child: Column( children: [ - Image.network( - meal.imageUrl, - height: 300, - width: double.infinity, - fit: BoxFit.cover, + Hero( + tag: meal.id, + child: Image.network( + meal.imageUrl, + height: 300, + width: double.infinity, + fit: BoxFit.cover, + ), ), const SizedBox(height: 14), 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) @@ -92,8 +95,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, + ), ), ), ], diff --git a/lib/widgets/meal_item.dart b/lib/widgets/meal_item.dart index 4d526c5..1c44b56 100644 --- a/lib/widgets/meal_item.dart +++ b/lib/widgets/meal_item.dart @@ -39,12 +39,15 @@ class MealItem extends StatelessWidget { }, child: Stack( children: [ - FadeInImage( - placeholder: MemoryImage(kTransparentImage), - image: NetworkImage(meal.imageUrl), - fit: BoxFit.cover, - height: 200, - width: double.infinity, + Hero( + tag: meal.id, + child: FadeInImage( + placeholder: MemoryImage(kTransparentImage), + image: NetworkImage(meal.imageUrl), + fit: BoxFit.cover, + height: 200, + width: double.infinity, + ), ), Positioned( bottom: 0,