in this reader widget i want to change the scrolling behavior so that if i'm zoomed in on an image and move arround the CarouselSlider dosen't slide to the next image unless i'm at the current image boundary.
I tried to change the scrollPhysics with every one I could find, without sucess.
There a similar questions around here, but none answered this problem.
how zoom in carouselslider in flutter?
flutter InteractiveViewer with CarouselSlider very difficult to pinch zoom
Here's the method handling the carousel:
CarouselSlider buildCarouselSlider() {
final double height = MediaQuery.of(context).size.height;
return CarouselSlider.builder(
itemCount: widget.file.pagesCount,
itemBuilder: (context, index, pageViewIndex) => Center(
child: PhotoView(
imageProvider: CachedNetworkImageProvider(widget.file.pagesUrl[index]),
onTapDown: (context, details, controllerValue) {
// Hide app bar on scroll down
setState(() {_showAppBar = !_showAppBar;});
},
backgroundDecoration: const BoxDecoration(color: Colors.black),
),
),
options: CarouselOptions(
autoPlay: false,
enableInfiniteScroll: false,
viewportFraction: 1.0,
enlargeCenterPage: false,
height: height,
clipBehavior: Clip.hardEdge,
pageSnapping: true,
scrollDirection: _axis,
initialPage: widget.file.currentPage,
scrollPhysics: const PageScrollPhysics(),
)
);
}