Search code examples
fluttercarouselassets

how to add Asset type image list into Carousel in flutter


I have list of Images in Asset type and I have already added items into it.

How can I show the Asset type image list in Carousel in flutter

List<Asset> images = List<Asset>();
    SizedBox(
                height: 150.0,
                width: 300.0,
                child: Carousel(
                  images: images,
                ),
                )

Solution

  •  List<Asset> images = List<Asset>();
         SizedBox(
                height: 500.0,
                width: 300.0,
                child: CarouselSlider(
                 items: images.map((image) => AssetThumb(
          asset: image,
          width: 300,
          height: 300,
        ),
    )).toList(
    ),)