Debug School

rakesh kumar
rakesh kumar

Posted on

Flutter: Setting the height of the AppBar

flutter-setting-the-height-of-the-appbar
Problem
How can I simply set the height of the AppBar in Flutter?

The title of the bar should be staying centered vertically (in that AppBar).

Image description

Solution:

toolbarHeight: 120, // Set this height
Enter fullscreen mode Exit fullscreen mode
AppBar(
  toolbarHeight: 120, // Set this height
  flexibleSpace: Container(
    color: Colors.orange,
    child: Column(
      children: [
        Text('1'),
        Text('2'),
        Text('3'),
        Text('4'),
      ],
    ),
  ),
)

Enter fullscreen mode Exit fullscreen mode

Image description

Top comments (0)