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