3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【flutter】「円」を描画するには??

Last updated at Posted at 2023-09-04

こんにちは。
今回は、円を描画する方法を紹介します。

方法

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

円を描画するには、「Containerウェジェット」を使います。

具体的には、「BoxDecorationクラス」の「shape引数」で、「BoxShape.circle」を指定します。

使用例

 @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.pink, //背景の色を選択
          title: const Text("Flutter!!!!"), //タイトルを表示
        ),
        body: Container(//以下を入れる
          height: 200,
          width: 200,
          decoration: const BoxDecoration(
            color: Colors.blue,
            shape: BoxShape.circle,
          ),
        ));
  }
}

実行例

スクリーンショット 2023-08-28 17.14.19.png

3
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
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?