Ad

How To Add Asset Type Image List Into Carousel In Flutter

- 1 answer

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,
                ),
                )
Ad

Answer

 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(
),)
Ad
source: stackoverflow.com
Ad