I was wondering how do you put a bottomsheet above the bottomnavbar, like for example the binance lite app as a case right here:
example
i tried using rootnavigator false but it didnt work because in my bottomnavbar, i got a logo and i want when i click on it, it pops up a modal but that logo from the bottomnavbar is still there.
Just using showbottommodalsheet doesnt work because it covers the bottomnavbar so the logo is not seen.
can u guys help me with a solution please?
this is my code for the bottomnavbar
BottomNavigationBarItem(
icon: GestureDetector(
onTap: () =>
showModalBottomSheet(context: context,
useRootNavigator: false,
builder: (BuildContext context) {
return Container();
})
,
child: Padding(
padding: const EdgeInsets.fromLTRB(0, 4, 0, 8),
child: Assets.images.logo.svg(),
),
),
label: 'Buy',
),
2
Answers
you can return a Column under the bottom sheet then use the bottom navbar and your bottom sheet item inside the column. this is the ideal solution.
first, create a widget for your bottom sheet it can be a separate dart file or inside a class. then put this code there:
OK, that’s it. You have to call
you can call this by the VoidCallBack method like this:
and The final result is this:
Hope it will solve your problem. let me know.