Skip to content

Left align center item doesn't work correctly #120

Open
@adamkoch

Description

@adamkoch

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions