Closed BobDickinson closed 5 months ago
I think the issue is in the background generator function:
indices: List.generate(
effectiveBackgroundCardCount,
(index) => (foregroundIndex + 1) % widget.cardCount,
),
That should be:
indices: List.generate(
effectiveBackgroundCardCount,
(index) => (foregroundIndex + 1 + index) % widget.cardCount,
),
I think (I'm very new to Flutter/Dart).
Plugin name Appinio Swiper etc.
Describe the bug In the Swiper Example app I added logging to the IndexedWidgetBuilder in the main AppInioSwiper widget and noticed that widget was creating the foreground card, and then creating only the topmost background card for each of the background cards visible in the stack.
The code change was just:
And the output was a series of:
flutter: Building card 2 (4) flutter: Building card 3
This seemed to indicate that instead of creating background cards 3, 4, 5, and 6 as expected, it created background card 3 four times.
To verify this, I modified the example card widget to show only the background color so you could tell them apart in the background stack, and I verified that for any given state, all of the background cards are the same (they are the same color as to topmost background card, until you swipe, then they all change to the color of the new topmost background card).
If the visible part of the card is different between cards, this is a pretty nasty bug.
To Reproduce Steps to reproduce the behavior:
Expected behavior Each background card rendered should have the correct index and be the correct card.