目次
まずは下準備でColumnの中にchildrenを入れる
Rowでしたい場合は、ColumnをRowに変えてください。
3行目のchild: のあとのとこ
Scaffold(
body: SafeArea( //iphone表示用
child: Column(
children: <Widget>[
// ここにContainerを入れる(今回は3つ)
],
),
);
Scaffold(
body: SafeArea( //iphone表示用
child: Column(
children: <Widget>[
Container(
height: 100.0,
width: 100.0,
color: Colors.indigo,
child: Text('ボックス1'),
),
Container(
width: 100.0,
height: 100.0,
color: Colors.green,
child: Text('ボックス2'),
),
Container(
width: 100.0,
height: 100.0,
color: Colors.white,
child: Text('3'),
),
],
),
);
こんな感じ

中央に配置
child: Column の下に「mainAxisAlignment: MainAxisAlignment.center,」を入れる。
Scaffold(
body: SafeArea( //iphone表示用
child: Column(
mainAxisAlignment: MainAxisAlignment.center, // ここ!!!
children: <Widget>[
Container(
height: 100.0,
width: 100.0,
color: Colors.indigo,
child: Text('ボックス1'),
こんな感じ

均等に配置 その1
child: Column の下に「mainAxisAlignment: MainAxisAlignment.spaceBetween,」を入れる。
Scaffold(
body: SafeArea( //iphone表示用
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, // ここ!!!
children: <Widget>[
Container(
height: 100.0,
width: 100.0,
color: Colors.indigo,
child: Text('ボックス1'),
こんな感じ

均等配置 その2
child: Column の下に「mainAxisAlignment: MainAxisAlignment.spaceEvenly,」を入れる。
Scaffold(
body: SafeArea( //iphone表示用
child: Column(
mainAxisAlignment: MainAxisAlignment. spaceEvenly, // ここ!!!
children: <Widget>[
Container(
height: 100.0,
width: 100.0,
color: Colors.indigo,
child: Text('ボックス1'),
こんな感じ
