こんにちは。
今回は、Columnを左寄せする方法を紹介します。
方法
Columnを左寄せするには、crossAxisAlignmentにCrossAxisAlignment.startを指定します。
使用例
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.pink, //背景の色を選択
title: const Text("Flutter!!!!"), //タイトルを表示
),
body: const Column(
crossAxisAlignment: CrossAxisAlignment.start, //これをつける
children: [
Text(
"太文字",
style: TextStyle(fontWeight: FontWeight.bold), //太文字
),
Text(
"文字色ピンク",
style: TextStyle(color: Colors.pink), //文字色ピンク
),
],
));
}
}