mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Flutter 3.29 beta (#2571)
This commit is contained in:
@@ -42,8 +42,13 @@ class SongDetailTab extends StatelessWidget {
|
||||
// to build while the hero transition is mid-flight.
|
||||
//
|
||||
// It could either be specified here or in SongsTab.
|
||||
flightShuttleBuilder: (context, animation, flightDirection,
|
||||
fromHeroContext, toHeroContext) {
|
||||
flightShuttleBuilder: (
|
||||
context,
|
||||
animation,
|
||||
flightDirection,
|
||||
fromHeroContext,
|
||||
toHeroContext,
|
||||
) {
|
||||
return HeroAnimatingSongCard(
|
||||
song: song,
|
||||
color: color,
|
||||
@@ -51,26 +56,24 @@ class SongDetailTab extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
const Divider(
|
||||
height: 0,
|
||||
color: Colors.grey,
|
||||
),
|
||||
const Divider(height: 0, color: Colors.grey),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (context, index) => switch (index) {
|
||||
0 => const Padding(
|
||||
padding: EdgeInsets.only(left: 15, top: 16, bottom: 8),
|
||||
child: Text(
|
||||
'You might also like:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
itemBuilder:
|
||||
(context, index) => switch (index) {
|
||||
0 => const Padding(
|
||||
padding: EdgeInsets.only(left: 15, top: 16, bottom: 8),
|
||||
child: Text(
|
||||
'You might also like:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
_ => const SongPlaceholderTile(),
|
||||
},
|
||||
_ => const SongPlaceholderTile(),
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -83,10 +86,7 @@ class SongDetailTab extends StatelessWidget {
|
||||
// ===========================================================================
|
||||
|
||||
Widget _buildAndroid(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(song)),
|
||||
body: _buildBody(),
|
||||
);
|
||||
return Scaffold(appBar: AppBar(title: Text(song)), body: _buildBody());
|
||||
}
|
||||
|
||||
Widget _buildIos(BuildContext context) {
|
||||
@@ -101,9 +101,6 @@ class SongDetailTab extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(context) {
|
||||
return PlatformWidget(
|
||||
androidBuilder: _buildAndroid,
|
||||
iosBuilder: _buildIos,
|
||||
);
|
||||
return PlatformWidget(androidBuilder: _buildAndroid, iosBuilder: _buildIos);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user