New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
STACK Layout - list order inverted #30
Comments
Just installed the library this morning @LampadinoMania and am facing pretty much the same issue. The weird thing is that |
FWIW here's a visual representation of what the issue is for me. As you can see, the (problematic) behaviour is the same as @LampadinoMania: Screen.Recording.2022-01-27.at.12.57.43.mov |
I had the same problem and you only have to change the version of the package, versions 2.0.0 and 2.0.1 have the same error, you should change it to 1.0.4. |
OK after some investigation in the internals of the lib and the previous commits, I managed to "fix" it. So, it seems like the issue is coming from: card_swiper/lib/src/custom_layout.dart Lines 210 to 215 in 7b6b68d
after this change was introduced: f7a9bf6#diff-d1e5d4e270664cc2388fc8b37dd68ef5f513da1be06c5e4d008fa9565f8d2eecL208-L213 So I forked the latest version, reverted this specific change and got to this status: the 1st item is correct, but not the following ones: Screen.Recording.2022-01-28.at.15.19.05.movFrom this, I made 2 changes in my own code to get it to work:
- itemBuilder: (BuildContext context, int index) => MyWidget(item: myList.elementAt(index)),
+ itemBuilder: (BuildContext context, int index) => MyWidget(item: myList.reversed.elementAt(index)), Which gets it to a valid state, minor the 1st item being off now: Screen.Recording.2022-01-28.at.15.20.02.mov
+ index: -1, And voilà! Screen.Recording.2022-01-28.at.15.20.41.movHope this helps you as well @LampadinoMania! |
This is fixed in latest version. Please check and confirm. Thanks! |
Just installed that latest version ( |
@TheAnkurPanchani This issue is still prevalent in the latest versions, except that it happens on autoplay rather than swipe. So when I use a STACK layout, manually swiping works fine, but the autoplay does the weird swapping mentioned above. I had to go all the way back to 1.0.4 to get a fully working implementation. |
@k-ane : Please raise a fresh issue. I will fix it asap. |
Good morning,
I am having a problem using STACK Layout with a list: it seems that the order of the elemets is inverted during elements swiping.
Example (gif attached):
It seems that the animation swiping is the opposite of the list shifting order.
Here's the code:
The text was updated successfully, but these errors were encountered: