Displaying a Line Below the AppBar in Flutter
Method
You can draw a line by passing a Border to the shape
property of the AppBar
.
AppBar(
title: Text('sample'),
shape: Border(
bottom: BorderSide(
color: Colors.blue,
width: 3,
),
),
)
Alternatively, you can achieve the same by setting a PreferredSize
to the bottom
property.
AppBar(
title: Text('sample'),
bottom: PreferredSize(
child: Container(
color: Colors.blue,
height: 3.0,
),
preferredSize: Size.fromHeight(3.0),
),
)