今回はみなさんのappBarをスケスケにしちゃいます!

こちらが該当するコード全体です。
Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar(
backgroundColor: Colors.white.withAlpha(100),
elevation: 0,
flexibleSpace: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(color: Colors.transparent),
),
),
title: const Text('名言'),
titleTextStyle: const TextStyle(
color: Colors.black,
fontSize: 25,
),
),
);
今回のメイン部分を見ていきましょう
extendBodyBehindAppBar: true,
本来であればappBar部分にbodyの要素を表示できませんがこのコードを追加するだけでappBar部分に表示が可能になります!
backgroundColor: Colors.white.withAlpha(100),
Colors.white.withAlphaを実行するだけでほぼ完成と言っても過言ではないです。
flexibleSpace: ClipRect(
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: Container(color: Colors.transparent),
),
),
このコードは追記してもどちらでもよろしいです。 追記することでappBar裏のWidgetにモザイクのようなものがかかるようになります。
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
また、ここの値を小さくすることでモザイクの粗さを調整することが可能になります。
appBarを透過させることでスタイリッシュなアプリ開発ができますね! ご一読いただきありがとうございました!
デザインの知識ゼロでも、書いて、答えて、選ぶだけ。AIがプロ品質のホームページを生成するサービス「ホムっぺ(ホムッペ・homppe)」を紹介します。無料で始められて、クレジットカード登録も不要です。
Read Moreデザインの知識ゼロでも、書いて、答えて、選ぶだけ。AIがプロ品質のホームページを生成するサービス「ホムっぺ(ホムッペ・homppe)」を紹介します。無料で始められて、クレジットカード登録も不要です。
Read More