-2

Bottom overflow in Drawer when I rotate the screen.

CopsOnRoad
  • 109,635
  • 30
  • 367
  • 257

3 Answers3

4

Use SingleChildScrollView like this

drawer: Drawer(
child: SingleChildScrollView(
        scrollDirection: Axis.vertical,
        child: Column(
        children: <Widget>[
                  YourWidgetsHere(),
                  YourWidgetsHere(),
                  YourWidgetsHere(),
                  YourWidgetsHere(),
                  YourWidgetsHere(),
                  YourWidgetsHere(),
                  YourWidgetsHere(),
                  YourWidgetsHere(),
        ]),),)

Or

Drawer(
        child: ListView(
          children: <Widget>[           
ListTile(
              dense: true,
              title: Text("Example"),
              leading: new Image.asset(
                "assets/images/example.png",
                width: 20.0,
              ),
            ),
]),), 
Lucas Matos
  • 446
  • 2
  • 8
  • What's the benefit of copying other 2 answers and putting it as yours? -1 from me. –  Sep 11 '19 at 09:07
  • What??!! Really look at the code and see it's different, okay? – Lucas Matos Sep 11 '19 at 18:25
  • Just by adding one or two properties doesn't make your code look unique, everyone can do that, the main point of question was to either use `ListView` or `SingleChildScrollView`, may I know what special value you added to the post? –  Sep 12 '19 at 09:28
3

Put it inside a SingleChildScrollView

Vettiyanakan
  • 5,790
  • 2
  • 27
  • 41
1

Use ListView for your Drawer.

drawer: Drawer(
  child: ListView(
    padding: EdgeInsets.zero,
    children: <Widget>[
      YourWidgetsHere(),
      YourWidgetsHere(),
      YourWidgetsHere(),
      YourWidgetsHere(),
      YourWidgetsHere(),
      YourWidgetsHere(),
      YourWidgetsHere(),
      YourWidgetsHere(),
    ],
  ),
)
CopsOnRoad
  • 109,635
  • 30
  • 367
  • 257