File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -220,7 +220,7 @@ class _ExpandableCarouselWidgetState extends State<ExpandableCarousel>
220220
221221 // Calculate the actual index in case of infinite scrolling
222222 var actualIndex = getRealIndex (
223- pageIndex.floor () + _carouselState! .initialPage, // Floor the page index
223+ pageIndex.round () + _carouselState! .initialPage, // Round the page index
224224 _carouselState! .realPage, // Initial real page
225225 widget.itemCount! , // Total number of items
226226 );
@@ -232,7 +232,7 @@ class _ExpandableCarouselWidgetState extends State<ExpandableCarousel>
232232 _firstPageLoaded = true ; // Set first page loaded flag
233233 _previousPage = _currentPage; // Update previous page
234234 _currentPage = actualIndex; // Update current page
235- _pageDelta = pageIndex - pageIndex.floor (); // Calculate delta
235+ _pageDelta = pageIndex - pageIndex.round (); // Calculate delta
236236 });
237237 }
238238 });
Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ class _FlutterCarouselState extends State<FlutterCarousel>
103103
104104 // Calculate the actual index in case of infinite scrolling
105105 var actualIndex = getRealIndex (
106- pageIndex.floor () + _carouselState! .initialPage, // Floor the page index
106+ pageIndex.round () + _carouselState! .initialPage, // Round the page index
107107 _carouselState! .realPage, // Initial real page
108108 widget.itemCount! , // Total number of items
109109 );
@@ -113,7 +113,7 @@ class _FlutterCarouselState extends State<FlutterCarousel>
113113 if (mounted) {
114114 setState (() {
115115 _currentPage = actualIndex; // Update current page
116- _pageDelta = pageIndex - pageIndex.floor (); // Calculate delta
116+ _pageDelta = pageIndex - pageIndex.round (); // Calculate delta
117117 });
118118 }
119119 });
You can’t perform that action at this time.
0 commit comments