我正在尝试使Widget与NavDrawer的底部对齐,同时仍将DrawerHeader和列表保留在Drawer的顶部。这是我正在尝试的:
drawer: new Drawer( child: new Column( mainAxisSize: MainAxisSize.max, children: <Widget>[ new Text('Top'), new Align( alignment: FractionalOffset.bottomCenter, child: new Text('Bottom'), ), ], ), ),
底部文本应与抽屉底部对齐,但事实并非如此!
您需要将AlignWidget 包装在中Expanded。
Align
Expanded
drawer: Drawer( child: Column( mainAxisSize: MainAxisSize.max, children: <Widget>[ Text('Top'), Expanded( child: Align( alignment: Alignment.bottomCenter, child: Text('Bottom'), ), ), ], ), ),