どうも、ちょげ(@chogetarou)です。
ButtonBarの配置の仕方を変える方法を紹介します。
方法

ButtonBarの配置の仕方を変えるには、引数「alignment」を使います。
引数「alignment」に、「MainAxisAlignment」の値を指定することで、配置の仕方を設定することが出来ます。
child: ButtonBar(
alignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
onPressed: () {},
child: Text('Button1'),
),
ElevatedButton(
onPressed: () {},
child: Text('Button2'),
),
ElevatedButton(
onPressed: () {},
child: Text('Button3'),
),
],
),

コメント