どうも、ちょげ(@chogetarou)です。
AppBarの枠線を丸くする方法を紹介します。
方法

@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
appBar: AppBar(
shape:RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20) //角の丸み
),
title: Text('Sample'),
),
body: Center()),
);
}
AppBarの角を丸くするには、引数「shape」を使います。
この引数に「RoundedRectangleBorderクラス」を指定することで、角を丸くすることが出来ます。
角の丸み具合は、引数「borderRadius」で設定します。
コメント