TheAnkurPanchani / card_swiper

Swiper/Carousel for flutter, with multiple layouts, infinite loop. Compatible with Android & iOS.
MIT License
155 stars 111 forks source link

Can I deactivate manual Swipe? #43

Open JoergPf opened 2 years ago

JoergPf commented 2 years ago

Hi, I would like to control the swipe only by functions. So the user should not be able to swipe manually. Is this possible? Thanks!

MAPLEOM commented 2 years ago

physics: const NeverScrollableScrollPhysics()

LouisDM commented 1 year ago

itemBuilder中使用GestureDetector覆盖原本的手势即可

Swiper(
                  itemBuilder: (BuildContext context, int swiperIndex) {
                    return GestureDetector(
                      // 覆盖本来的滑动翻页
                      onPanStart: (DragStartDetails details) {},
                      child: Container(),
                    );
                  },
                  axisDirection: AxisDirection.right,
                  controller: states.swiperController,
                  itemCount: 10,
                  itemWidth: 300,
                  itemHeight: 300,
                  loop: false,
                  layout: SwiperLayout.TINDER,
                )