如何在颤动中显示图像滑块?
How to show image slider in flutter?
我有一个名为 Src 的图像列表 url。我想通过这个包显示这些图像:https://pub.dev/packages/flutter_image_slideshow。但是什么时候这样做:
Container(
width: pageWidth,
height: pageHeight / 2.5,
// color: Colors.red,
child: ImageSlideshow(
children: [
CachedNetworkImage(
imageUrl: src,
),
],
)
);
控制台说:
type 'List<String>' is not a subtype of type 'String'
当我像这样将我的列表转换为字符串时:
CachedNetworkImage(
imageUrl: src.toString().replaceAll("[", "").replaceAll("]", ""),
),
控制台说:
I/flutter ( 4859): CacheManager: Failed to download file from https://ahmadihypermarket.com/ext/uploads/2021/11/1-378.jpg, https://ahmadihypermarket.com/ext/uploads/2021/11/2-290.jpg with error:
I/flutter ( 4859): HttpException: Invalid statusCode: 404, uri = https://ahmadihypermarket.com/ext/uploads/2021/11/1-378.jpg,%20https://ahmadihypermarket.com/ext/uploads/2021/11/2-290.jpg
有人知道如何修复它并显示图像吗?
试试下面的代码
Container(
width: pageWidth,
height: pageHeight / 2.5,
// color: Colors.red,
child: ImageSlideshow(
children:List<Widget>.generate(
src.length,
(index) {
return CachedNetworkImage(
imageUrl: src[index],
);
},
),
)
);
我有一个名为 Src 的图像列表 url。我想通过这个包显示这些图像:https://pub.dev/packages/flutter_image_slideshow。但是什么时候这样做:
Container(
width: pageWidth,
height: pageHeight / 2.5,
// color: Colors.red,
child: ImageSlideshow(
children: [
CachedNetworkImage(
imageUrl: src,
),
],
)
);
控制台说:
type 'List<String>' is not a subtype of type 'String'
当我像这样将我的列表转换为字符串时:
CachedNetworkImage(
imageUrl: src.toString().replaceAll("[", "").replaceAll("]", ""),
),
控制台说:
I/flutter ( 4859): CacheManager: Failed to download file from https://ahmadihypermarket.com/ext/uploads/2021/11/1-378.jpg, https://ahmadihypermarket.com/ext/uploads/2021/11/2-290.jpg with error:
I/flutter ( 4859): HttpException: Invalid statusCode: 404, uri = https://ahmadihypermarket.com/ext/uploads/2021/11/1-378.jpg,%20https://ahmadihypermarket.com/ext/uploads/2021/11/2-290.jpg
有人知道如何修复它并显示图像吗?
试试下面的代码
Container(
width: pageWidth,
height: pageHeight / 2.5,
// color: Colors.red,
child: ImageSlideshow(
children:List<Widget>.generate(
src.length,
(index) {
return CachedNetworkImage(
imageUrl: src[index],
);
},
),
)
);