Browse Source

no message

ios
ZHR007 4 months ago
parent
commit
e3ffa62cea
1 changed files with 22 additions and 22 deletions
  1. 44
      lib/pages/discover/live_item_widget.dart

44
lib/pages/discover/live_item_widget.dart

@ -1,3 +1,4 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/controller/discover/room_controller.dart';
import 'package:dating_touchme_app/generated/assets.dart';
import 'package:dating_touchme_app/model/discover/rtc_channel_model.dart';
@ -54,29 +55,28 @@ class _LiveItemWidgetState extends State<LiveItemWidget> {
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.w)),
),
child: widget.channel != null &&
widget.channel!.channelPic.isNotEmpty
? Image.network(
widget.channel!.channelPic,
width: 171.w,
height: 171.w,
fit: BoxFit.cover,
errorBuilder: (context, error, stackTrace) {
print('图片加载失败: ${widget.channel!.channelPic}');
return Image.network(
"https://picsum.photos/400",
width: 171.w,
height: 171.w,
fit: BoxFit.cover,
);
},
)
: Image.network(
"https://picsum.photos/400",
width: 171.w,
height: 171.w,
fit: BoxFit.cover,
child: CachedNetworkImage(
imageUrl: "${ widget.channel!.channelPic}?x-oss-process=image/format,webp/resize,w_240",
width: 171.w,
height: 171.w,
fit: BoxFit.cover,
placeholder: (context, url) => Container(
color: Colors.white38,
child: Center(
child: CircularProgressIndicator(
strokeWidth: 1.w,
color: Colors.grey,
),
),
),
errorWidget: (context, url, error) =>
Image.asset(
Assets.imagesUserAvatar,
width: 171.w,
height: 171.w,
fit: BoxFit.cover,
),
)
),
Positioned(
top: 0,

Loading…
Cancel
Save