@@ -43,34 +43,49 @@ class _DrinkDetailScreenState extends State<DrinkDetailScreen> {
4343 );
4444 }
4545
46+ final theme = Theme .of (context);
47+
4648 return Scaffold (
47- appBar: AppBar (
48- actions: [
49- IconButton (
50- icon: const Icon (Icons .share),
51- onPressed: () => _shareDrink (context, drink, provider.currentFestival),
49+ body: CustomScrollView (
50+ slivers: [
51+ SliverAppBar (
52+ expandedHeight: 220 ,
53+ pinned: true ,
54+ backgroundColor: theme.colorScheme.primaryContainer,
55+ foregroundColor: theme.colorScheme.onPrimaryContainer,
56+ title: Text (drink.name),
57+ actions: [
58+ IconButton (
59+ icon: const Icon (Icons .share),
60+ onPressed: () => _shareDrink (context, drink, provider.currentFestival),
61+ ),
62+ IconButton (
63+ icon: Icon (
64+ drink.isFavorite ? Icons .favorite : Icons .favorite_border,
65+ ),
66+ onPressed: () => provider.toggleFavorite (drink),
67+ ),
68+ ],
69+ flexibleSpace: FlexibleSpaceBar (
70+ background: SafeArea (
71+ child: _buildHeader (context, drink),
72+ ),
73+ ),
5274 ),
53- IconButton (
54- icon: Icon (
55- drink.isFavorite ? Icons .favorite : Icons .favorite_border,
75+ SliverToBoxAdapter (
76+ child: Column (
77+ crossAxisAlignment: CrossAxisAlignment .start,
78+ children: [
79+ _buildRatingSection (context, drink, provider),
80+ _buildInfoChips (context, drink),
81+ if (drink.notes != null ) _buildDescription (context, drink),
82+ if (drink.allergenText != null ) _buildAllergens (context, drink),
83+ _buildBrewerySection (context, drink, provider),
84+ ],
5685 ),
57- onPressed: () => provider.toggleFavorite (drink),
5886 ),
5987 ],
6088 ),
61- body: SingleChildScrollView (
62- child: Column (
63- crossAxisAlignment: CrossAxisAlignment .start,
64- children: [
65- _buildHeader (context, drink),
66- _buildRatingSection (context, drink, provider),
67- _buildInfoChips (context, drink),
68- if (drink.notes != null ) _buildDescription (context, drink),
69- if (drink.allergenText != null ) _buildAllergens (context, drink),
70- _buildBrewerySection (context, drink, provider),
71- ],
72- ),
73- ),
7489 );
7590 }
7691
@@ -158,6 +173,7 @@ class _DrinkDetailScreenState extends State<DrinkDetailScreen> {
158173 Padding (
159174 padding: const EdgeInsets .all (24 ),
160175 child: Column (
176+ mainAxisSize: MainAxisSize .min,
161177 crossAxisAlignment: CrossAxisAlignment .start,
162178 children: [
163179 Text (
0 commit comments