In our app we\'re using a bottomSheet along with a bottomNavigationBar.
The bottomSheet appears above the bottomNavigationBar, is there a way to make it appear underneat
You can combine your popup with the bottom navigation bar using Column
and simulate bottom sheet behavior using Expandable:
import 'package:flutter/material.dart';
import 'package:expandable/expandable.dart';
void main() {
runApp(SampleApp());
}
class SampleApp extends StatefulWidget {
@override
_SampleAppState createState() => new _SampleAppState();
}
class _SampleAppState extends State<SampleApp> {
@override
Widget build(BuildContext context) {
buildBottomSheet() {
return Container(
color: Colors.grey[200],
child: Column(mainAxisSize: MainAxisSize.min, children: [
RadioListTile(dense: true, title: Text('Test'), groupValue: 'test', onChanged: (value) {}, value: true),
RadioListTile(dense: true, title: Text('Test'), groupValue: 'test', onChanged: (value) {}, value: true),
]));
}
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('Sample App'),
),
body: Container(
color: Colors.green,
),
bottomNavigationBar: ExpandableNotifier(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ExpandableButton(
child: SizedBox(height: 50,
child: Center(
child: Icon(Icons.edit),
),
),
),
Expandable(
expanded: buildBottomSheet(),
),
],
),
),
),
);
}
}
For a production app, consider using SafeArea
to add proper padding at the bottom.
Noticed your question. Had same problem and found better solution. Use showModalBottomSheet()
. It will overlay bottom navigation.
add : useRootNavigator: true,
showModalBottomSheet(
context: context,
useRootNavigator: true,
builder: (context) {},
);