facebook twitter hatena line email

Flutter/UI/横縦並び・比率

提供: 初心者エンジニアの簡易メモ
2019年11月14日 (木) 22:47時点におけるAdmin (トーク | 投稿記録)による版

移動: 案内検索
Row(children: <Widget>[
    Expanded(child: Container(
    padding: EdgeInsets.all(20.0),
    child: Text("1"),
    color: Colors.grey,
    ),),
    Expanded(child: Container(
    padding: EdgeInsets.all(20.0),
    child: Text("2"),
    color: Colors.red,
    ),),
    Expanded(child: Container(
    padding: EdgeInsets.all(20.0),
    child: Text("3"),
    color: Colors.green,
    ),),
    Expanded(child: Container(
    padding: EdgeInsets.all(20.0),
    child: Text("4"),
    color: Colors.blue,
    ),),
        ],),

上の20は高さ。

参考:https://nzigen.com/flutter-reference/2018-04-18-row-expanded.html