[Flutter]AppBarの形状を変えるには?

Flutter

どうも、ちょげ(@chogetarou)です。

AppBarの形を変えるには、どうしたらいいのでしょうか?

スポンサーリンク

方法

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          "Title",
        ),
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(40)
        ),
      ),
      body: Center(),
    );
  }

AppBarの形を変えるには、引数「shape」を使います。

「shape」に形を指定することで、AppBarの形を設定できます。

コメント

タイトルとURLをコピーしました