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

outer doesn't work with alignment. #36

Open
seu1902 opened this issue Dec 28, 2018 · 1 comment
Open

outer doesn't work with alignment. #36

seu1902 opened this issue Dec 28, 2018 · 1 comment

Comments

@seu1902
Copy link

seu1902 commented Dec 28, 2018

new Swiper(
itemBuilder: (BuildContext context, int index) {
return Image.network("http://via.placeholder.com/350x220");
},
itemCount: 5,
itemWidth: 300.0,
itemHeight: 220.0,
layout: SwiperLayout.STACK,
outer: true,
pagination: new SwiperPagination(
alignment: Alignment.topCenter,
),
),

if I didn't set outer = true, the alignment in pagination would always work; but as long as I set outer = true, the indicators would not be on the topCenter of the swiper any more.

Any suggestions?

@congni congni mentioned this issue Feb 20, 2019
@d3vtoolsmith
Copy link

You can work around the bug by setting outer: false and then wrapping your items inside a Container with some top padding:

new Swiper(
itemBuilder: (BuildContext context, int index) {
return Container(
padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
child: Image.network("http://via.placeholder.com/350x220"));
},
...
outer: false);

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