Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/src/_expandable_carousel_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class _ExpandableCarouselWidgetState extends State<ExpandableCarousel>

// Calculate the actual index in case of infinite scrolling
var actualIndex = getRealIndex(
pageIndex.floor() + _carouselState!.initialPage, // Floor the page index
pageIndex.round() + _carouselState!.initialPage, // Round the page index
_carouselState!.realPage, // Initial real page
widget.itemCount!, // Total number of items
);
Expand All @@ -232,7 +232,7 @@ class _ExpandableCarouselWidgetState extends State<ExpandableCarousel>
_firstPageLoaded = true; // Set first page loaded flag
_previousPage = _currentPage; // Update previous page
_currentPage = actualIndex; // Update current page
_pageDelta = pageIndex - pageIndex.floor(); // Calculate delta
_pageDelta = pageIndex - pageIndex.round(); // Calculate delta
});
}
});
Expand Down
4 changes: 2 additions & 2 deletions lib/src/_flutter_carousel_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class _FlutterCarouselState extends State<FlutterCarousel>

// Calculate the actual index in case of infinite scrolling
var actualIndex = getRealIndex(
pageIndex.floor() + _carouselState!.initialPage, // Floor the page index
pageIndex.round() + _carouselState!.initialPage, // Round the page index
_carouselState!.realPage, // Initial real page
widget.itemCount!, // Total number of items
);
Expand All @@ -113,7 +113,7 @@ class _FlutterCarouselState extends State<FlutterCarousel>
if (mounted) {
setState(() {
_currentPage = actualIndex; // Update current page
_pageDelta = pageIndex - pageIndex.floor(); // Calculate delta
_pageDelta = pageIndex - pageIndex.round(); // Calculate delta
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: flutter_carousel_widget
description: A customizable Flutter carousel widget with infinite scrolling, auto-scrolling, pre-built indicators, expandable widgets, auto-sized child support, and enlarged center page.

version: 3.1.0
version: 3.1.1

homepage: https://pub.dev/packages/flutter_carousel_widget
repository: https://github.com/nixrajput/flutter_carousel_widget
Expand Down