Skip to content
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

The data.center is showing wrong values #15

Open
lambasoft opened this issue Feb 27, 2019 · 3 comments
Open

The data.center is showing wrong values #15

lambasoft opened this issue Feb 27, 2019 · 3 comments

Comments

@lambasoft
Copy link

lambasoft commented Feb 27, 2019

In my code, the data.center is not showing the correct indexes, sometimes it's even showing the same center index for different pages.


SnapList(
    padding: EdgeInsets.only(
        left: (screenSize.width - cardSize.width) / 2),
    sizeProvider: (index, data) => cardSize,
    separatorProvider: (index, data) => Size(10.0, 10.0),
    positionUpdate: (int index) {
        print("Current Index: ${index}/${pageCards.length}");
        if (index == pageCards.length - 1) {
            //                          loadMore();
        }
    },
    builder: (context, index, data) {
        print("###########################");
        print("Index: ${index}");
        print("Center: ${data.center}");
        print("Next: ${data.next}");
        print("Progress: ${data.progress}");
        return ProfileCard(pageCards[index], image1, offset,
            () {}, dismissCard);
    },
    count: pageCards.length,
)
@lambasoft
Copy link
Author

I think its because the builder is not being updated with the latest center index when the scroll event is finished. Im working on a fix

@lambasoft
Copy link
Author

I might be the problem, but the data provided to the builder is all wrong values.
Can someone confirm?

@phattranky
Copy link

@lambasoft I got same your problem that I mentioned at #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants