flutter の学び4.5

flutter
この記事は約3分で読めます。

AppBarのチャットiconを左よせにする方法がわかった。

右に寄りすぎているが、一旦これでよし。

actionsを設定すればいけた。

        appBar: AppBar(
          bottom: PreferredSize(
              preferredSize: const Size.fromHeight(1),
              child: Container(
                height: 1,
                color: const Color.fromARGB(255, 194, 194, 194),
              )),
          elevation: 0.0,
          backgroundColor: Colors.white,
          title: Row(
            // mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: const [
              Icon(
                Icons.camera_alt,
                color: Colors.black,
              ),
              SizedBox(width: 8),
              Text(
                'instagram',
                style: TextStyle(
                  fontFamily: 'PassionsConflict',
                  fontSize: 40,
                  fontWeight: FontWeight.bold,
                  color: Colors.black,
                ),
              ),
            ],
          ),
// ↓これ
          actions: const [
            Icon(
              Icons.chat,
              color: Colors.black,
            ),
          ],
        ),

右に寄りすぎているので、これはpaddingとか設定すればいいのだろうか。

とりあえず、よし!

参考

【Flutter】AppBarの使い方まとめ|Flutterラボ
Flutterアプリ開発で頻出Widgetの『AppBar』ですが、初心に戻って改めて使い方を解説したいと思います。 Flutterラボ|動画で学ぶFlutter学習サイト Flutter・Dart・Firebaseに関するアプリ制作の技術を学ぶことができます。プログラミング初心者から経験者まで flu...

コメント

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