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

Disabling Infinite Looping feature #123

Closed
danausx opened this issue Aug 28, 2019 · 2 comments
Closed

Disabling Infinite Looping feature #123

danausx opened this issue Aug 28, 2019 · 2 comments

Comments

@danausx
Copy link

danausx commented Aug 28, 2019

Is there any way to disable the loop feature and have it act as a standard scrolling list but just using the snap feature?

The infinite loop makes it hard to use this as anything else but very long lists. Short lists make it confusing as they loop around and items appear doubled.

@MattL-NZ
Copy link

MattL-NZ commented Sep 2, 2019

You can just use loop: false

    itemBuilder: (BuildContext context, int index) {
    return new ClipRRect(
       borderRadius: new BorderRadius.circular(10.0),
       child: Image.network(
         "http://via.placeholder.com/288x188",
          fit: BoxFit.fill,
         )
     );
},
 itemCount: 3,
 index: 0,
 viewportFraction: 1.0,
 scale: 0.9,
 loop: false,
 pagination: SwiperPagination(                   
 )
)

@danausx
Copy link
Author

danausx commented Sep 2, 2019

Oh wow, this is great. I was convinced the loop parameter was just for the automatic slideshow mode.
This is perfect 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

2 participants