flutter_carousel_widget
flutter_carousel_widget copied to clipboard
[Bug]: initialPage parameter should affect the slide indicators
Contact Details
What happened?
Given the initialPage parameter in CarouselOptions, the slide indicators always start with index 0.
I extended one of the slide indicators and wrote this and it works as expected:
class ModifiedCircularSlideIndicator extends CircularSlideIndicator {
const ModifiedCircularSlideIndicator({
super.itemSpacing,
super.indicatorRadius,
super.indicatorBorderWidth,
super.indicatorBorderColor,
super.padding,
super.alignment,
super.currentIndicatorColor,
super.indicatorBackgroundColor,
required this.startIndex,
});
final int startIndex;
@override
Widget build(int currentPage, double pageDelta, int itemCount) {
final newCurrentPage = (startIndex + currentPage) % itemCount
return super.build(newCurrentPage, pageDelta, itemCount);
}
}
Version
2.2.0
What devices are you seeing the problem on?
Android, iPhone
OS
iOS 16
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hi @canbi,
Thank you for raising this issue. It's a bug and I will look into the issue. If you have any questions, please talk about them more. You may also make a PR if you have a tested solution.
Regards, Nikhil
Is there an estimated completion time for this? Thanks!