rickywen911 / custom_bubble_navigation_bar

A custom navigation bar with bubble click effect in Flutter
MIT License
220 stars 49 forks source link

Set the width of a floating navbar #16

Closed SilkeNL closed 3 years ago

SilkeNL commented 3 years ago

I was wondering if it is possible to set the width of the floating navbar?

Navbar that I have now:

CustomNavigationBar( selectedColor: Color(0xFF279B40), strokeColor: Color(0xFF279B40), unSelectedColor: Colors.grey[600], backgroundColor: Colors.white, items: [ CustomNavigationBarItem( icon: Icon(Icons.notifications), title: Text("Meldingen", style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600),), ), CustomNavigationBarItem( icon: Icon(Icons.home), title: Text("Dashboard", style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600),), ), ], currentIndex: _activeIndex, onTap: (page) { _controller.animateToPage( page, duration: const Duration(milliseconds: 250), curve: Curves.fastOutSlowIn, ); }, borderRadius: Radius.circular(16.0), isFloating: true, ),

rickywen911 commented 3 years ago

@SilkeNL I think it can be done if I provide a parameter to control the padding when isFloating is true. Unfortunately, I am quite busy these days, I will have spare time in April to make the change or if you like to change it and make a pull request is also welcomed.