我正在寻找一种方法来设置抽屉头的高度.我有这个DrawerHeader:
DrawerHeader(
child: Text('Categories', style: TextStyle(color: Colors.white)),
decoration: BoxDecoration(
color: Colors.black
),
margin: EdgeInsets.all(0.0),
padding: EdgeInsets.all(0.0)
))
Run Code Online (Sandbox Code Playgroud)
但我没有看到将高度设置为抽屉的方法,这太大了.
Shu*_*der 30
你用Container小部件包装它.
Container(
height: 10.0,
child: DrawerHeader(
child: Text('Categories', style: TextStyle(color: Colors.white)),
decoration: BoxDecoration(
color: Colors.black
),
margin: EdgeInsets.all(0.0),
padding: EdgeInsets.all(0.0)
),
);
Run Code Online (Sandbox Code Playgroud)
您可以使用SizedBox小部件来调整高度DrawerHeader
new SizedBox(
height : 120.0,
child : new DrawerHeader(
child : new Text('Categories', style: TextStyle(color: Colors.white)),
decoration: new BoxDecoration(color: Colors.black),
margin : EdgeInsets.all(0.0),
padding: EdgeInsets.all(0.0)
),
);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6252 次 |
| 最近记录: |