1
0
mirror of https://github.com/stonega/tsacdop synced 2025-01-21 19:35:28 +01:00

Fixed fireside host load error.

This commit is contained in:
stonegate 2020-08-09 23:11:37 +08:00
parent 5d1c9a8ec1
commit 7e2d340713

View File

@ -226,65 +226,73 @@ class _PodcastDetailState extends State<PodcastDetail> {
child: SingleChildScrollView( child: SingleChildScrollView(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: hosts children: hosts
.map((host) => Container( .map<Widget>((host) {
padding: EdgeInsets.all(5.0), final image = host.image ==
width: 80.0, "http://xuanmei.us/assets/default/avatar_small-"
child: Column( "170afdc2be97fc6148b283083942d82c101d4c1061f6b28f87c8958b52664af9.jpg"
mainAxisAlignment: ? "https://fireside.fm/assets/default/avatar_small"
MainAxisAlignment.center, "-170afdc2be97fc6148b283083942d82c101d4c1061f6b28f87c8958b52664af9.jpg"
mainAxisSize: MainAxisSize.min, : host.image;
children: <Widget>[ return Container(
CachedNetworkImage( padding: EdgeInsets.all(5.0),
imageUrl: host.image, width: 80.0,
progressIndicatorBuilder: child: Column(
(context, url, mainAxisAlignment:
downloadProgress) => MainAxisAlignment.center,
SizedBox( mainAxisSize: MainAxisSize.min,
width: 40, children: <Widget>[
height: 2, CachedNetworkImage(
child: imageUrl: image,
LinearProgressIndicator( progressIndicatorBuilder:
(context, url,
downloadProgress) =>
SizedBox(
width: 40,
height: 2,
child: LinearProgressIndicator(
value: value:
downloadProgress downloadProgress
.progress), .progress),
), ),
errorWidget: errorWidget:
(context, url, error) => (context, url, error) =>
CircleAvatar(
backgroundColor:
Colors.grey[400],
backgroundImage: AssetImage(
'assets/fireside.jpg'),
),
imageBuilder: (context,
hostImage) =>
CircleAvatar( CircleAvatar(
backgroundColor: backgroundColor:
Colors.grey[400], Colors
backgroundImage: AssetImage( .grey[400],
'assets/fireside.jpg'), backgroundImage:
), hostImage),
imageBuilder: (context, ),
hostImage) => Padding(
CircleAvatar( padding: EdgeInsets.all(2),
backgroundColor: ),
Colors.grey[400], Text(
backgroundImage: host.name,
hostImage), style: TextStyle(
), backgroundColor: Colors
Padding( .black
padding: EdgeInsets.all(2), .withOpacity(0.5),
), color: Colors.white,
Text( ),
host.name, textAlign: TextAlign.center,
style: TextStyle( maxLines: 2,
backgroundColor: Colors.black overflow: TextOverflow.fade,
.withOpacity(0.5), ),
color: Colors.white, ],
), ));
textAlign: TextAlign.center, })
maxLines: 2, .toList()
overflow: TextOverflow.fade, .cast<Widget>()),
),
],
)))
.toList()
.cast<Widget>(),
),
), ),
)), )),
); );