Change top color on Drawer widget in Flutter

Viewed 363

I'm wondering how I can change the top-most color seen when my Drawer is open?

In the image below you can see two arrows, 1 and 2. Arrow 2 points at my main screen which is my primaryColor and is shown correctly on all screens except on my drawer.

I'm trying to have an all white drawer and want to remove the grey color from the top.

enter image description here

3 Answers

I think this may solve your issue, by removing padding of ListView.

drawer: new Drawer(
  child: new ListView(
    padding: const EdgeInsets.all(0.0),
    children: <Widget>[
       ......
    ]
  ),
),

Wrap your Drawer with SafeArea widget

I also had this my app, I changed ListView to Column and it worked. Usually, we don't keep too much in Drawer so Column worked for me.

drawer: new Drawer(
child: new Column(                  ///here change ListView to Column
padding: const EdgeInsets.all(0.0),
children: <Widget>[
   ......
]

), ),

Related