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

ontap not working when a page has index 1 #28

Open
parth181195 opened this issue Dec 7, 2018 · 4 comments
Open

ontap not working when a page has index 1 #28

parth181195 opened this issue Dec 7, 2018 · 4 comments

Comments

@parth181195
Copy link

parth181195 commented Dec 7, 2018

i am trying to use ontap and I am having a wired issue where it does not work when i am on page 0 and i click on page 1

child: Swiper(
              autoplay: false,
              controller: controller,
              index: data,
              onIndexChanged: (index) {
                setState(() {
                  data = index;
                });
              },
              physics: BouncingScrollPhysics(),
              itemCount: 10,
              loop: false,
              viewportFraction: 0.7,
              scale: 0.7,
              containerHeight: 200,
              itemBuilder: (context, index) {
                return GestureDetector(
                  onTap: () {
                    if (index > data) {
                      controller.next();
                    } else if (index < data) {
                      controller.previous();
                    }
                  },
                  child: Container(
                    color: Colors.primaries[index],
                    child: Center(
                      widthFactor: 0,
                      child: Text('$data $index'),
                    ),
                  ),
                );
              },
            ),
@JanGeleijnse123
Copy link

did this get fixed? my gesturedetector in swiper is not working either

@bernaferrari
Copy link

bernaferrari commented Sep 4, 2019 via email

@JanGeleijnse123
Copy link

anyone can think of a workaround?

@hbali
Copy link

hbali commented Oct 27, 2019

Hi, I had the same problem with the default PageView as well. When viewportFraction < 1 and only one element exists then you cant click on it. There is a fix for it that have been merged but it's still on 'dev' release:

flutter/flutter#37024

You need to update flutter to this release:
In the terminal, write:
flutter version v1.10.14

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

4 participants