Flutter does not have a built-in BottomDrawer widget. To implement a bottom navigation drawer, you must compose a custom Widget using ListTile, Divider, and Text widgets.
Implementation Pattern:
- Animation: Use a
PositionedTransition to animate the visibility of the drawer. - Trigger: The opening and closing of the drawer should be triggered by a menu icon within a
BottomAppBar located in the bottomNavigationBar slot of a Scaffold. - Usage: Bottom drawers are typically used in conjunction with bottom app bars.
bottomNavigationBar: BottomAppBar(
child: Row(
children: [
IconButton(
icon: Icon(Icons.menu),
onPressed: () {
// Animate a bottom drawer
},
),
Spacer(),
IconButton(icon: Icon(Icons.search), onPressed: () {}),
IconButton(icon: Icon(Icons.more_vert), onPressed: () {}),
],
),
),