okaryo.log

Displaying a Line Below the AppBar in Flutter | okaryo.log

Displaying a Line Below the AppBar in Flutter

    #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),
  ),
)

References


Related Posts
Related Posts
Promotion

This site uses Google Analytics.