2

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 2

5

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
            )
          ],
        ),
      ),
1

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
              ),
            )
            )
          ],
        ),
      ),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.