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

Touch size of icon is too small #5

Open
apgapg opened this issue Mar 7, 2020 · 6 comments
Open

Touch size of icon is too small #5

apgapg opened this issue Mar 7, 2020 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@apgapg
Copy link

apgapg commented Mar 7, 2020

I think the touch area for icon is small. Only when you precisely touch icon then only it receives touch. Can we have something with which we can increase. touch area for icons? Its little inconvinient to change tabs

@apgapg apgapg changed the title Touch size off icon is too small Touch size of icon is too small Mar 7, 2020
@sooxt98
Copy link
Owner

sooxt98 commented Mar 7, 2020

@apgapg Thanks for the feedback ,I have introduce two new attributes in version 2.1.0 which is debug & tabMargin for GNav to increase the touchable area.

ac9affd

@nohli
Copy link

nohli commented Aug 18, 2020

I've maximized the touch area of the icons by wrapping them in a Flexible widget:

https://github.com/nohli/google_nav_bar/commit/fa47ff658f85565c063e1801b3198a3bdc41caa4

You could try it by adding this to your pubspec.yaml:

  google_nav_bar:
    git:
      url: https://github.com/nohli/google_nav_bar

Right now, it's not perfect - it collapses for a short moment when changing tabs, but it looks okay, when setting something like:

            curve: Curves.easeInOutSine,
            duration: const Duration(milliseconds: 700),

(because of this I also removed the variable clickable, which blocked another tab switching for the full animation duration)

@sooxt98
Copy link
Owner

sooxt98 commented Aug 19, 2020

@nohli wow interesting,I'll try it out

@sooxt98
Copy link
Owner

sooxt98 commented Aug 19, 2020

hi @nohli it just changed the behaviour of the animation, which doesn't match with the original one; the button must stick infront

@nohli
Copy link

nohli commented Aug 19, 2020

@sooxt98 try wrapping the GButton/gButton with
Container(color: Colors.red, child: ...)
(in your code line 67, in my fork line 98):

before:
before
after:
after

The red painting also reflects the touchable area.

@0x01001
Copy link

0x01001 commented Mar 19, 2024

same issue on v5.0.6

@sooxt98 sooxt98 added the enhancement New feature or request label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants