FlutterでAppBarの下に線を表示させたい
方法
AppBarのshapeプロパティにBorderを渡してあげると線を引くことができる。
AppBar(
title: Text('sample'),
shape: Border(
bottom: BorderSide(
color: Colors.blue,
width: 3,
),
),
)
または、bottomプロパティにPreferredSizeを設定することでも同様のことが可能だ。
AppBar(
title: Text('sample'),
bottom: PreferredSize(
child: Container(
color: Colors.blue,
height: 3.0,
),
preferredSize: Size.fromHeight(3.0),
),
)