简体   繁体   中英

how zoom in carouselslider in flutter?

i have a widget that return a carouselslider and i want to zoom and pinch image

this is my code:

Widget myPicture() {
List<Widget> items = [];

for (var i in widget.product.imageUrlList) {
  items.add(
    Image.network(i),
  );
}

return CarouselSlider(
  items: items,
  options: CarouselOptions(
    enlargeCenterPage: false,
  ),
);

  }

i try to write like this:

Widget myPicture() {

List<Widget> items = [];

for (var i in widget.product.imageUrlList) {
  items.add(
    Image.network(i),
  );
}

return InteractiveViewer(
  child: CarouselSlider(
    items: items,
    options: CarouselOptions(
      enlargeCenterPage: false,
    ),
  ),
);
  }

but it doesn't work too

what should I do?

you can use photo view package

PhotoView(
          imageProvider: AssetImage(photos),
          backgroundDecoration: BoxDecoration(color: Colors.white),
        ),

this article helps you create what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM