flutter_floating_bottom_navigation_bar icon indicating copy to clipboard operation
flutter_floating_bottom_navigation_bar copied to clipboard

Getting a white thick margin around the FloatingNavBar

Open mjarpitanand opened this issue 3 years ago • 5 comments

Same as #2

mjarpitanand avatar Dec 08 '20 10:12 mjarpitanand

Doesn't work anymore since new versions of flutter, tryna find a new way

right7ctrl avatar Dec 16 '20 06:12 right7ctrl

still having this issue

AliEasy avatar Jan 13 '21 12:01 AliEasy

It looks like setting Scaffold.extendBody to true is not enough. You also have to manually add a MediaQuery widget whose bottom padding matches the height of the bottomNavigationBar above the scaffold's body. This works for me:

final MediaQueryData queryData = MediaQuery.of(context);

return MaterialApp( title: 'Floating NavBar Example', home: Scaffold( appBar: AppBar( title: Text('Floating NavBar Example'), centerTitle: true, ), extendBody: true, body: MediaQuery( data: queryData.copyWith( size: Size( queryData.size.width, queryData.size.height + queryData.padding.bottom, ), ), child: Center(child: Text("index: $_index"),), ), bottomNavigationBar: FloatingNavbar( onTap: (int val) => setState(() => _index = val), currentIndex: _index, items: [ FloatingNavbarItem(icon: Icons.home, title: 'Home'), FloatingNavbarItem(icon: Icons.explore, title: 'Explore'), FloatingNavbarItem(icon: Icons.chat_bubble_outline, title: 'Chats'), FloatingNavbarItem(icon: Icons.settings, title: 'Settings'), ], ), ), );

cbonello avatar Mar 07 '21 18:03 cbonello

It may be due to elevation property as it fills all the background.

prateekmedia avatar Jun 21 '21 07:06 prateekmedia

Having the same issue.

From the DevTools, it seems that this Padding is what's causing it image

GitGud31 avatar Jul 10 '21 20:07 GitGud31