|
|
|
@ -116,6 +116,47 @@ class _RecommendTabState extends State<RecommendTab> |
|
|
|
child: SingleChildScrollView( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12), |
|
|
|
margin: EdgeInsets.only(bottom: 10.w), |
|
|
|
height: 90.w, |
|
|
|
child: Swiper( |
|
|
|
autoplay: true, |
|
|
|
itemCount: controller.bannerLint.length, |
|
|
|
loop: true, |
|
|
|
onTap: (int index){ |
|
|
|
print(index); |
|
|
|
if(controller.bannerLint[index].jumpType == 2){ |
|
|
|
Get.to(() => OpenWebView(url: controller.bannerLint[index].jumpValue ?? "")); |
|
|
|
} else if(controller.bannerLint[index].jumpType == 3){ |
|
|
|
TDImageViewer.showImageViewer(context: context, images: [controller.bannerLint[index].jumpValue ?? ""]); |
|
|
|
} |
|
|
|
}, |
|
|
|
itemBuilder: (BuildContext context, int index) { |
|
|
|
return CachedNetworkImage( |
|
|
|
imageUrl: controller.bannerLint[index].image ?? "", |
|
|
|
height: 90.w, |
|
|
|
fit: BoxFit.cover, |
|
|
|
|
|
|
|
imageBuilder: (context, imageProvider) => Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
image: DecorationImage( |
|
|
|
image: imageProvider, |
|
|
|
fit: BoxFit.cover, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
errorWidget: (context, url, error) => Image.asset( |
|
|
|
Assets.imagesUserAvatar, |
|
|
|
width: 165.w, |
|
|
|
height: 165.w, |
|
|
|
fit: BoxFit.cover, |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12), |
|
|
|
margin: EdgeInsets.only(bottom: 10.w), |
|
|
|
@ -255,47 +296,6 @@ class _RecommendTabState extends State<RecommendTab> |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
padding: EdgeInsets.symmetric(horizontal: 12), |
|
|
|
margin: EdgeInsets.only(bottom: 10.w), |
|
|
|
height: 90.w, |
|
|
|
child: Swiper( |
|
|
|
autoplay: true, |
|
|
|
itemCount: controller.bannerLint.length, |
|
|
|
loop: true, |
|
|
|
onTap: (int index){ |
|
|
|
print(index); |
|
|
|
if(controller.bannerLint[index].jumpType == 2){ |
|
|
|
Get.to(() => OpenWebView(url: controller.bannerLint[index].jumpValue ?? "")); |
|
|
|
} else if(controller.bannerLint[index].jumpType == 3){ |
|
|
|
TDImageViewer.showImageViewer(context: context, images: [controller.bannerLint[index].jumpValue ?? ""]); |
|
|
|
} |
|
|
|
}, |
|
|
|
itemBuilder: (BuildContext context, int index) { |
|
|
|
return CachedNetworkImage( |
|
|
|
imageUrl: controller.bannerLint[index].image ?? "", |
|
|
|
height: 90.w, |
|
|
|
fit: BoxFit.cover, |
|
|
|
|
|
|
|
imageBuilder: (context, imageProvider) => Container( |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(8), |
|
|
|
image: DecorationImage( |
|
|
|
image: imageProvider, |
|
|
|
fit: BoxFit.cover, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
errorWidget: (context, url, error) => Image.asset( |
|
|
|
Assets.imagesUserAvatar, |
|
|
|
width: 165.w, |
|
|
|
height: 165.w, |
|
|
|
fit: BoxFit.cover, |
|
|
|
), |
|
|
|
); |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
ListView.separated( |
|
|
|
shrinkWrap: true, // ⭐ 关键 1:高度由内容决定 |
|
|
|
physics: const NeverScrollableScrollPhysics(), // ⭐ 关键 2:禁用自身滚动 |
|
|
|
|