Flutter align button to bottom of Drawer

后端 未结 6 588
慢半拍i
慢半拍i 2021-02-03 21:29

I\'m trying to have a Widget align to the bottom of my NavDrawer while still keeping a DrawerHeader and a list at the top of the Drawer. Here\'s what I\'m trying:



        
6条回答
  •  北恋
    北恋 (楼主)
    2021-02-03 22:35

    You need to wrap your Align widget in Expanded.

    drawer: Drawer(
      child: Column(
        mainAxisSize: MainAxisSize.max,
        children: [
          Text('Top'),
          Expanded(
            child: Align(
              alignment: Alignment.bottomCenter,
              child: Text('Bottom'),
            ),
          ),
        ],
      ),
    ),
    

提交回复
热议问题