I'm trying to show bottom sheet and let user pick choice. I did like so
showModalBottomSheet(
context: context,
builder: (builder) {
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new ListTile(
leading: new Icon(Icons.image),
title: new Text('From gallary'),
),
new ListTile(
leading: new Icon(Icons.camera_alt),
title: new Text('Take video'),
),
],
);
});
However it barely visible because of bottom navigation bar. It looks like this. I want to implement minimum height bottom sheet coming up from top edge of the bottom navigation bar. How can I achieve this?
Modal bottom sheets can be created and displayed using the showModalBottomSheet function. The showModalBottomSheet has two required properties: BuildContext and WidgetBuilder .
Solution. In summary, we can make a transparent app bar by set backgroundColor to Colors. transparent (1), elevation to 0 (2), and title color to anything different from background color (3).
The showModalBottomSheet
has useRootNavigator
which is by default false
. The documentation says:
The
useRootNavigator
parameter ensures that the root navigator is used to display the [BottomSheet] when set totrue
. This is useful in the case that a modal [BottomSheet] needs to be displayed above all other content but the caller is inside another [Navigator].
I think that is solution to your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With