sooxt98 / google_nav_bar

A modern google style nav bar for flutter.
MIT License
735 stars 114 forks source link

How to center the icon without text? #74

Closed PINHOf closed 2 years ago

PINHOf commented 2 years ago

As you can see in the image, the text has been removed, but the icon is not centered. image

I have set the gap to zero.

GNav(
    iconSize: 24,
    padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12),
    duration: Duration(milliseconds: 400),
    gap: 0,
    tabs: [
      GButton(
        icon: Icons.home,
        backgroundColor: Colors.white,
        iconColor: Colors.black,
        iconActiveColor: Colors.purple,
        borderRadius: BorderRadius.all(Radius.circular(30)),
      ),
    ],
    selectedIndex: selectedScreenIndex,
    onTabChange: (index) {
      setState(() {
        selectedScreenIndex = index;
      });
    },
),
sooxt98 commented 2 years ago

I think it’s not possible for now, this navbar mostly use with text, will look into it in the future when we introducing material you design, could you try the older version? I believe v2 and v3 don’t have this issue

On Fri, 11 Mar 2022 at 12:53 AM, PINHOf @.***> wrote:

As you can see in the image, the text has been removed, but the icon is not centered. [image: image] https://user-images.githubusercontent.com/6898403/157713551-052c7d30-7444-460a-8dff-e496d95d08ec.png

I have set the gap to zero.

GNav( iconSize: 24, padding: EdgeInsets.symmetric(horizontal: 20, vertical: 12), duration: Duration(milliseconds: 400), gap: 0, tabs: [ GButton( icon: Icons.home, backgroundColor: Colors.white, iconColor: Colors.black, iconActiveColor: Colors.purple, borderRadius: BorderRadius.all(Radius.circular(30)), ), ], selectedIndex: selectedScreenIndex, onTabChange: (index) { setState(() { selectedScreenIndex = index; }); }, ),

— Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/74, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGCEC3DXEZKYMQM4YSY7LDU7ISHDANCNFSM5QNGTEAA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

PINHOf commented 2 years ago

Oh, ok, thank you. I'm trying to achieve the goal below, can you point me in the right plugin direction? There are so many 😅

image

sooxt98 commented 2 years ago

You could try this https://pub.dev/packages/flutter_snake_navigationbar

Can’t help you much on this one

On Fri, 11 Mar 2022 at 1:03 AM, PINHOf @.***> wrote:

Oh, ok, thank you. I'm trying to achieve the goal below, can you point me in the right plugin direction? There are so many 😅

[image: image] https://user-images.githubusercontent.com/6898403/157716165-20016111-5679-4be2-b0db-c4f1b5423b4e.png

— Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/74#issuecomment-1064292346, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGCEC2RYXNJOLHQ3NMPKMTU7ITPPANCNFSM5QNGTEAA . You are receiving this because you commented.Message ID: @.***>

sooxt98 commented 2 years ago

Btw have you tried downgrading the version? Should have fix it I think

On Fri, 11 Mar 2022 at 1:11 AM, Sheldon Soo @.***> wrote:

You could try this https://pub.dev/packages/flutter_snake_navigationbar

Can’t help you much on this one

On Fri, 11 Mar 2022 at 1:03 AM, PINHOf @.***> wrote:

Oh, ok, thank you. I'm trying to achieve the goal below, can you point me in the right plugin direction? There are so many 😅

[image: image] https://user-images.githubusercontent.com/6898403/157716165-20016111-5679-4be2-b0db-c4f1b5423b4e.png

— Reply to this email directly, view it on GitHub https://github.com/sooxt98/google_nav_bar/issues/74#issuecomment-1064292346, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGCEC2RYXNJOLHQ3NMPKMTU7ITPPANCNFSM5QNGTEAA . You are receiving this because you commented.Message ID: @.***>

PINHOf commented 2 years ago

Btw have you tried downgrading the version? Should have fix it I think On Fri, 11 Mar 2022 at 1:11 AM, Sheldon Soo @.> wrote: You could try this https://pub.dev/packages/flutter_snake_navigationbar Can’t help you much on this one On Fri, 11 Mar 2022 at 1:03 AM, PINHOf @.> wrote: > Oh, ok, thank you. I'm trying to achieve the goal below, can you point me > in the right plugin direction? There are so many 😅 > > [image: image] > https://user-images.githubusercontent.com/6898403/157716165-20016111-5679-4be2-b0db-c4f1b5423b4e.png > > — > Reply to this email directly, view it on GitHub > <#74 (comment)>, > or unsubscribe > https://github.com/notifications/unsubscribe-auth/ADGCEC2RYXNJOLHQ3NMPKMTU7ITPPANCNFSM5QNGTEAA > . > You are receiving this because you commented.Message ID: > @.***> >

Worked great, downgraded to version 3x. Thanks.