どうも、ちょげ(@chogetarou)です。
Rowの高さを設定する方法を紹介します。
方法

Rowの高さを設定するには、SizedBoxもしくはContainerを使います。
まず、RowをSizedBoxもしくはContainerでラップします。
そして、SizedBoxもしくはContainerの引数「height」に高さを設定します。
SizedBox(
height: /*高さ*/,
child: Row(
children: [
・・・
],
),
),
SizedBoxもしくはContainerを使うことで、Rowの高さを設定することが出来ます。
使用例
以下は、使用例です。

@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Container(
height: 100,
child: Row(
children: [
Expanded(
child: Container(
color: Colors.blue,
),
),
Expanded(
child: Container(
color: Colors.yellow,
width: 100,
),
),
Expanded(
child: Container(
color: Colors.pink,
width: 100,
),
),
],
),
),
),
);
}
コメント