5
0

More than 1 year has passed since last update.

【flutter】Columnを左寄せするには?

Last updated at Posted at 2023-08-30

こんにちは。
今回は、Columnを左寄せする方法を紹介します。

方法

スクリーンショット 2023-08-13 20.18.51.png

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), //文字色ピンク
            ),
          ],
        ));
  }
}

実行例

スクリーンショット 2023-08-25 9.17.20.png

5
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
0