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

后端 未结 11 2193
广开言路
广开言路 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:29

    I have used this approach,

    What i want is, A layout always in bottom but whenever Keyboard pops-up that layout also comes over it

    body: Container(
            color: Colors.amber,
            height: double.maxFinite,
            child: new Stack(
              //alignment:new Alignment(x, y)
              children: [
                new Positioned(
                  child: myWidget(context, data.iconName, Colors.red),
                ),
                new Positioned(
                  child: new Align(
                    alignment: FractionalOffset.bottomCenter,
                    child: myWidget(context, data.iconName, Colors.green)
                  ),
                )
              ],
            ),
          ),
    

提交回复
热议问题