how can i postion the text in bottom left in the drawer header and reduce the drawer header height?

Viewed 1459

So i just want to postion the text in the bottom left of the drawer header and also reduce the height of the drawer header

drawer: new Drawer
      (
        child: ListView
        (
          children: <Widget>
          [
            new DrawerHeader
            (
              child: Text("Drawer Header"),
              decoration: BoxDecoration
              (
                color: Colors.blueGrey
              ),
            )
          ],
        ),
      ),

enter image description here

2 Answers

You can just wrap your Text widget in a container that aligns it. To change the size of the header just add another container around the Header that sets the height.

new Drawer(
        child: ListView(
          children: <Widget>[
            Container(
              child: new DrawerHeader(
                child: Container(
                  child: Text("Drawer Header"),
                  alignment: Alignment.bottomLeft, // <-- ALIGNMENT
                  height: 10,
                ),
                decoration: BoxDecoration(color: Colors.blueGrey),
              ),
                height: 50,      // <-- HEIGHT
            )
          ],
        ),
      ),

just wrap your DrawerHeader with a SizedBox

and wrap your Text with a Align widget

drawer: Drawer
      (
        child: ListView
        (
          children: <Widget>
          [
            SizedBox(
              height: 150,
              child: DrawerHeader
            (
              child: Align(
                alignment: Alignment.bottomLeft,
                child: Text("Drawer Header")
              ),
              decoration: BoxDecoration
              (
                color: Colors.blueGrey
              ),
            )
            )
          ],
        ),
      ),
Related