How to align a Column's child to the bottom

后端 未结 4 2290
后悔当初
后悔当初 2021-02-18 14:30

I\'m trying to build a generic home page and I want to align the last child of my column (which contains all the widgets for the page) to the bottom of the screen but the widget

4条回答
  •  盖世英雄少女心
    2021-02-18 15:04

    I have always used Spacer for these kind of cases in Column or Row. Spacer takes up all the available space between two widgets of Row/Column.

    For given example, you can try following

         Column(
          mainAxisSize: MainAxisSize.max,
          children: [
            ChildA(),
            ChildB(),
            Spacer(),
            BottomAlignedChild()
         
          ]
        )
    

提交回复
热议问题