Flutter: Trying to bottom-center an item in a Column, but it keeps left-aligning

后端 未结 11 2196
广开言路
广开言路 2020-12-07 18:54

I\'m trying to bottom-center a widget at the bottom of a Column, but it keeps aligning to the left.

return new Column(
  new Stack(
    new Positioned(
              


        
11条回答
  •  不知归路
    2020-12-07 19:13

    If you wish to leave content as it, can wrap it with scrollable.

    Useful if you have inputs in the children:

        return Stack(
          children: [
            Positioned(
              child: SingleChildScrollView(
                  child: Column(
                      children: children
                        ..add(Container(
                          height: 56, // button heigh, so could scroll underlapping area
                        )))),
            ),
            Positioned(
              child: Align(
                alignment: Alignment.bottomCenter,
                child: button,
              ),
            )
          ],
        );
    

提交回复
热议问题