-2

I'm attempting to implement a Flutter drawer similar to the ChatGPT Android App, aiming for a fullscreen background color that covers both the top status bar and bottom taskbar. However, I'm encountering difficulties in achieving this effect. Despite experimenting with various approaches, such as adjusting the Drawer widget and color properties, I haven't been able to replicate the desired outcome. Any insights or code snippets on how to extend the drawer's background color seamlessly throughout the screen, including the status and task bars, would be greatly appreciated. Thank you!

I have tried using SystemChrome.setSystemUIOverlayStyle to change the color of the status bar and bottom taskbar but it does not give the desired effect. I have also tried using the Scaffold widget as a drawer but it still does not work.

mlodhi
  • 153
  • 1
  • 10

1 Answers1

0

Use your custom drawer in Scaffold widget

`drawer: ContainerDrawer(),

Customize the content, background color, width, etc like a Container.

class ContainerDrawer extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Color drawerBackgroundColor = Colors.teal;

    return Container(
      color: drawerBackgroundColor,
      child: Column(
        children: [
          DrawerHeader(child: Text('Drawer Header')),
          ListTile(title: Text('Item 1')),
          ListTile(title: Text('Item 2')),
          // Add more list items or content as needed
        ],
      ),
    );
  }
}