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

How to get pop up effect using snaplist #11

Open
saltpetre opened this issue Jan 14, 2019 · 6 comments
Open

How to get pop up effect using snaplist #11

saltpetre opened this issue Jan 14, 2019 · 6 comments

Comments

@saltpetre
Copy link

@ariedov Hi,

how did you get the pop effect of the card in the vertical scroll list. I am referring to the screenshot you have with list of diff movies.

I am able to get the scroll but can't figure out the pop of effect of the card when it comes to the center.

Thanks

@ariedov
Copy link
Owner

ariedov commented Feb 26, 2019

Hey! Sorry for the late response.

You could provide a custom sizeProvider to the list and calculate the height using the params it provides.
The progress param is quite crucial for that.

I can't share the code that is used in the gif on README.md, because it is used in a closed project.

@phattranky
Copy link

phattranky commented May 27, 2019

Hi @ariedov,

I implement your suggestion. But seem it's only working with Next navigate

sizeProvider: (index, data) {
              if (data.center == index - 1) {
                final height = cardSize.height + data.progress;
                return Size(cardSize.width, height);
              }

              return cardSize;
            },

screencast 2019-05-28 06-42-21

When I debug, Look the Index, Center value not correct when I navigate back like this issue #15. What was wrong?

@phattranky
Copy link

Hi @saltpetreca, Do you resolve this issue?

@saltpetre
Copy link
Author

saltpetre commented May 28, 2019 via email

@phattranky
Copy link

Hi @saltpetreca ,

I can solve the popup effect issue with my code mentioned above. But about the index still not yet

@arndt-s
Copy link

arndt-s commented Jan 17, 2020

I've came up with the following workaround:

if (data.progress == 0 && data.center == index) {
  return cardSize;
} else if (data.next < data.center && data.next == index) {
  return cardSize;
} else if (data.next >= data.center && data.center == index - 1) {
  return cardSize;
} else {
  return cardSizeSmall;
}

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

4 participants