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

Left align center item doesn't work correctly #120

Open
adamkoch opened this issue Aug 14, 2019 · 1 comment
Open

Left align center item doesn't work correctly #120

adamkoch opened this issue Aug 14, 2019 · 1 comment

Comments

@adamkoch
Copy link

Is it possible to achieve something like this with swiper?
https://stackoverflow.com/questions/55699500/dont-center-a-pageview-flutter

Basically left align the current item and have the next item (to the right) peeking onto the screen.

I tried doing something like this:

Swiper(
  layout: SwiperLayout.CUSTOM,
  itemWidth: 250.0,
  itemHeight: 200.0,
  customLayoutOption: CustomLayoutOption(
    startIndex: -1,
    stateCount: 3,
  ).addTranslate([
    Offset(-330.0, 0.0),
    Offset(-80.0, 0.0),
    Offset(170.0, 0.0),
  ])
...

Basically offset the left item off the screen, the center item to the left and right item next to that. Which seems to render OK, but then the scrolling behaviour is not correct (when swiping the right item into view it appears "on top" of the center item).

Thanks!

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

1 participant