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

swipperController.next() and swipperController.previous() does not change the selected card #141

Open
JoaoSaran opened this issue Oct 18, 2019 · 0 comments

Comments

@JoaoSaran
Copy link

I'm doing some tests and I'm calling swipperController.previous inside the onIndexChanged method of the swipper. Both next() and previous() have no effect whatsoever. Here is the code Im using:

_listPerguntas.isNotEmpty 
         ?  Swiper(
              itemCount: _listPerguntas.length,
              controller: _swiperController,
              loop: false,
              layout: SwiperLayout.TINDER,
              itemWidth: MediaQuery.of(context).size.width * 0.8,
              itemHeight: MediaQuery.of(context).size.width * 0.5,
              itemBuilder: (BuildContext context, int index) {
                return _listPerguntas[index];
              },
              onIndexChanged: (index) {
               print('index changed');
                _swiperController.previous();
              },
            )
         :  Container(),
            

is the implementation wrong or is this a legit issue?

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