LoginSignup
8
8

はじめに

この記事は、株式会社スピードリンクジャパン Advent Calendar 2023 の19日目の記事です。

こんにちは。
今回は、wrapの方向を縦で表示する方法を紹介します!:blush:

方法

スクリーンショット 2023-08-13 20.18.51.png
Wrapの引数にdirectionを追加し、
Axis.verticalに設定します。

使用例

 @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("wrapを縦にする"),
      ),
      body: Wrap(
        direction: Axis.vertical,
        children: <Widget>[
          Container(
            width: 100,
            height: 100,
            color: Colors.red,
          ),
          Container(
            width: 100,
            height: 100,
            color: Colors.blue,
          ),
          Container(
            width: 100,
            height: 100,
            color: Colors.yellow,
          )
        ],
      ),
    );
  }
}

実行例

スクリーンショット 2023-12-18 19.22.11.png

最後に

ここまで見てくだり、ありがとうございます!!
寒い日が続きますので、体調にはお気をつけください:relaxed:

8
8
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
8
8