0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Flutter】CenterウィジェットでColumnが上下真ん中にならない

Posted at

概要

CenterColumnを囲んでいるのに真ん中にならない問題についての備忘録
調べればいくらでもでできますが個人のメモとして。。。

結論

ColumnmainAxisSize: MainAxisSize.minプロパティを加える

問題

Center(
    child: Column(
        children: [
            Text('テキスト1'),
            Text('テキスト2')
            ],
         ),
     );

解決方法

Center(
    child: Column(
        mainAxisSize: MainAxisSize.min,
        children: [
            Text('テキスト1'),
            Text('テキスト2')
            ],
         ),
     );
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?