diff --git a/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart b/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart index 85cfe805..617fc878 100644 --- a/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart +++ b/flutter/lib/features/recipes/presentation/recipe_detail_screen.dart @@ -45,24 +45,31 @@ class RecipeDetailScreen extends ConsumerWidget { message: mapErrorToUserMessage(error, context), onRetry: () => ref.invalidate(recipeDetailProvider(recipeId)), ), - data: (recipe) => Stack( - children: [ - if (recipe.imageUrl != null) - SizedBox( - height: MediaQuery.of(context).size.height * 2 / 3, - child: Image.network( - recipe.imageUrl!, - fit: BoxFit.cover, - width: double.infinity, - alignment: Alignment.topCenter, - ), + data: (recipe) => CustomScrollView( + slivers: [ + SliverAppBar( + expandedHeight: MediaQuery.of(context).size.height * 2 / 3, + flexibleSpace: FlexibleSpaceBar( + background: recipe.imageUrl != null + ? Image.network( + recipe.imageUrl!, + fit: BoxFit.cover, + ) + : Container(color: Colors.grey[200]), ), - SingleChildScrollView( - child: Column( - children: [ - SizedBox(height: MediaQuery.of(context).size.height * 2 / 3), - _RecipeBody(recipe: recipe), - ], + pinned: true, + floating: false, + ), + SliverToBoxAdapter( + child: Container( + decoration: const BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + ), + child: _RecipeBody(recipe: recipe), ), ), ],