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

Viewport not working with custom layout #279

Open
Davete0302 opened this issue Sep 15, 2021 · 0 comments
Open

Viewport not working with custom layout #279

Davete0302 opened this issue Sep 15, 2021 · 0 comments

Comments

@Davete0302
Copy link

I wanted to show 3 items in swipper so I adjusted na viewportFraction/itemWidth to .6 but does not seem to work.
Just wanted to show 3 items like the default swipper while retaining the swipe animation.

new Swiper(
  layout: SwiperLayout.CUSTOM,
  customLayoutOption: new CustomLayoutOption(
      startIndex: -1,
      stateCount: 3
  ).addRotate([
    -45.0/180,
    0.0,
    45.0/180
  ]).addTranslate([
    new Offset(-370.0, -40.0),
    new Offset(0.0, 0.0),
    new Offset(370.0, -40.0)
  ]),
  itemWidth: 300.0,
  itemHeight: 200.0,
  itemBuilder: (context, index) {
    return new Container(
      color: Colors.grey,
      child: new Center(
        child: new Text("$index"),
      ),
    );
  },
  viewportFraction: 0.6,
  itemCount: 10)
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