google_nav_bar icon indicating copy to clipboard operation
google_nav_bar copied to clipboard

Touch size of icon is too small

Open apgapg opened this issue 5 years ago • 6 comments

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 avatar Mar 07 '20 06:03 apgapg

@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.

https://github.com/sooxt98/google_nav_bar/commit/ac9affd6f23d2dc089978939bd30dcac48b07017

sooxt98 avatar Mar 07 '20 18:03 sooxt98

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)

nohli avatar Aug 18 '20 20:08 nohli

@nohli wow interesting,I'll try it out

sooxt98 avatar Aug 19 '20 05:08 sooxt98

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

sooxt98 avatar Aug 19 '20 10:08 sooxt98

@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.

nohli avatar Aug 19 '20 11:08 nohli

same issue on v5.0.6

0x01001 avatar Mar 19 '24 06:03 0x01001