どうも、ちょげ(@chogetarou)です。
AppBarのタイトルを右に寄せるには、どうしたらいいのでしょうか?
方法

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [Text("Title")]),
),
body: Center(),
);
}
AppBarのタイトルを右側に寄せるには、引数「title」にRowを指定します。
そして、Rowの引数「mainAxisAlignment」に、「MainAxisAlignment.end」を指定することで、タイトルが右に寄せられます。
コメント