Flutter : 列を垂直に中央揃えにする 質問する

Flutter : 列を垂直に中央揃えにする 質問する

Flutter で列を垂直に中央揃えにするにはどうすればよいでしょうか? ウィジェット「new Center」を使用しました。 ウィジェット「new Center」を使用しましたが、列が垂直に中央揃えになりません。 何かアイデアがあれば教えてください。

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text("Thank you"),
    ),
    body: new Center(
      child: new Column(
        children: <Widget>[
          new Padding(
            padding: new EdgeInsets.all(25.0),
            child: new AnimatedBuilder(
              animation: animationController,
              child: new Container(
                height: 175.0,
                width: 175.0,
                child: new Image.asset('assets/angry_face.png'),
              ),
              builder: (BuildContext context, Widget _widget) {
                return new Transform.rotate(
                  angle: animationController.value * 6.3,
                  child: _widget,
                );
              },
            ),
          ),
          new Text('We are glad we could serve you...', style: new TextStyle(
              fontSize: 16.0,
              fontWeight: FontWeight.w600,
              color: Colors.black87),),
          new Padding(padding: new EdgeInsets.symmetric(vertical: 5.0, horizontal: 0.0)),
          new Text('We appreciate your feedback ! !', style: new TextStyle(
              fontSize: 13.0,
              fontWeight: FontWeight.w200,
              color: Colors.black87),),
        ],
      ),
    ),
  );
}

ベストアンサー1

Aziz が提案する解決策は次のとおりです。

Column(
  mainAxisAlignment: MainAxisAlignment.center,
  crossAxisAlignment: CrossAxisAlignment.center,
  children: [
    //your widgets here...
  ],
)

パディングのため、正確に中央に配置されません。

padding: EdgeInsets.all(25.0),

少なくともこの場合は、列を正確に中央に配置するには、パディングを削除する必要があります。

おすすめ記事