0

I want to have an IconButton below title of an AppBar. I tried Column, but I had problem with center all items there and with overflowing bottom.

My Code:

appBar: new AppBar( title: Column( children: <Widget>[ new Text('App Title'), IconButton( icon: new Icon(new IconData(0xe902, fontFamily: 'Ionicons')), onPressed: () {}, ) ], ), centerTitle: true, actions: <Widget>[ IconButton( icon: new Icon(new IconData(0xe906, fontFamily: 'Ionicons')), onPressed: () {}, ) ], ), 

It should looks like this.

2 Answers 2

1

You can try this

appBar: AppBar( centerTitle: true, title: Column( mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ Text("App Title"), GestureDetector( child: Icon(Icons.keyboard_arrow_down), onTap: () { // handle your click here }, ) ], ), ), 

Screenshot: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

1

Possible duplicate of this. Maybe you can try to reduce the sizes of your Text & IconButton widgets to avoid overflow (it won't look good) and add crossAxisAlignment: CrossAxisAlignment.center in your Column widget to center the Column's children in it's cross axis.

If none of that will work, maybe you can build your own appbar widget since everything is a widget on flutter..

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.