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

no touchable when using CustomLayoutOption #1

Closed
mamonraab opened this issue Jul 7, 2021 · 6 comments
Closed

no touchable when using CustomLayoutOption #1

mamonraab opened this issue Jul 7, 2021 · 6 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@mamonraab
Copy link

hello itry to make my CustomLayoutOption on top of wiper but swiping the slide with touch fingers not working

my code is

` Swiper(itemCount: _sliddata.length,

     itemBuilder:  (context, index) {
       return imgbuildr(index);
     },

     scrollDirection: Axis.horizontal,

     loop: true,

     control: new SwiperControl(
         color: Colors.red
     ),


     pagination: new SwiperPagination(
         margin: new EdgeInsets.all(5.0),
         builder: new DotSwiperPaginationBuilder(
             color: Colors.grey, activeColor: Colors.red)

     ),


     viewportFraction: 0.1,

     scale: 2,
     itemHeight: MediaQuery.of(context).size.height * 0.3,
     itemWidth: MediaQuery.of(context).size.width * 0.85 ,
     autoplayDelay: 9250,
     duration: 622,

     layout:
     SwiperLayout.CUSTOM,
     customLayoutOption: new CustomLayoutOption(
       startIndex: -1,
       stateCount: 3,

     ).addOpacity([
       0.6,
       0.6,
       1.0


     ])


         .addRotate([

       0.03,
       0.03,
       0.0

     ])



         .addScale([
       0.8,
       0.8,
       0.96

     ],Alignment.center )

         .addTranslate([
       //offset(left,upp)
       new Offset(-100.0, 5.0),
       new Offset(100 , 5.0 ),
       new Offset(0.0, 0.0)
     ]),
   ) ,`
@TheAnkurPanchani
Copy link
Owner

@mamonraab : Hi, Could you please provide a main.dart file with reproducible minimal code sample?

@mamonraab
Copy link
Author

mamonraab commented Jul 7, 2021

@TheAnkurPanchani after double check the problem , it happened when i use the slider inside a screen that is inside the TabBarView() , when i remove it from there it work but i want to keep using the TabBarView coz it is a big part on my app
it is a large news app i will try to memic the problem and send a simple code

@mamonraab
Copy link
Author

mamonraab commented Jul 7, 2021

@TheAnkurPanchani here is a link for the problem , as mentioned when putting the swiper with my costum layout
is not working https://github.com/mamonraab/card_swiper_problem_demo

@mamonraab
Copy link
Author

mamonraab commented Jul 8, 2021

@TheAnkurPanchani also to mention this happen when using customLayoutOption while using default settings work nice

@mamonraab
Copy link
Author

any update ??

@TheAnkurPanchani TheAnkurPanchani added bug Something isn't working help wanted Extra attention is needed labels Dec 20, 2021
@TheAnkurPanchani TheAnkurPanchani self-assigned this Dec 20, 2021
@TheAnkurPanchani
Copy link
Owner

I found cause of the problem in already opened issue under flutter repo. Here is the link,
flutter/flutter#59555

If you want swiper takes all the swipe gestures and doesn't want swipes to change tab views then you can use suggestion mentioned in the comment, Here is the link,
flutter/flutter#59555 (comment)

Try setting physics: NeverScrollableScrollPhysics(), in TabBarView

child: TabBarView(
  physics: const NeverScrollableScrollPhysics(),
  children: [

Repository owner locked as resolved and limited conversation to collaborators Mar 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants