Flutter : Vertically center column

后端 未结 9 593
失恋的感觉
失恋的感觉 2020-12-13 23:02

How to vertically center a column in Flutter? I have used widget \"new Center\". I have used widget \"new Center\", but it does not vertically center my column ? Any ideas w

9条回答
  •  庸人自扰
    2020-12-13 23:35

    For me the problem was there was was Expanded inside the column which I had to remove and it worked.

    Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Expanded( // remove this
                  flex: 2,
                  child: Text("content here"),
                ),
              ],
            )
    

提交回复
热议问题