所以我只想将文本放置在抽屉标题的左下角,并减少抽屉标题的高度
drawer: new Drawer
(
child: ListView
(
children: <Widget>
[
new DrawerHeader
(
child: Text("Drawer Header"),
decoration: BoxDecoration
(
color: Colors.blueGrey
),
)
],
),
),
Run Code Online (Sandbox Code Playgroud)
您只需将文本小部件包装在对齐它的容器中即可。要更改标题的大小,只需在标题周围添加另一个容器来设置高度。
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)
| 归档时间: |
|
| 查看次数: |
2416 次 |
| 最近记录: |