如何将文本放置在抽屉标题的左下角并降低抽屉标题的高度?

mou*_*_99 2 android flutter

所以我只想将文本放置在抽屉标题的左下角,并减少抽屉标题的高度

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

在此输入图像描述

Mit*_*tch 5

您只需将文本小部件包装在对齐它的容器中即可。要更改标题的大小,只需在标题周围添加另一个容器来设置高度。

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
            )
          ],
        ),
      ),
Run Code Online (Sandbox Code Playgroud)