Home > Mobile >  How to add text below an IconButton in Flutter
How to add text below an IconButton in Flutter

Time:08-10

I have a Button Icon in the appbar of my app, in which I need to put a text below the "send" icon. How should I do it?

          actions: <Widget>[
        IconButton(
          icon: Icon(
            Icons.send,
            color: Colors.green,
          ),
          onPressed: () {
            localRequestScheduleChange();
          },
        ),
      ],
    ),

CodePudding user response:

Wrap your IconButton with Column widget and add Text

actions: <Widget>[
  Column(
    children: [
      IconButton(
        icon: Icon(
          Icons.send,
          color: Colors.green,
        ),
        onPressed: () {},
      ),
      Text("Send"),
    ],
  ),
],

CodePudding user response:

Yes, just like Khanh mentions you can use a column. In your case it would be wrap your icon button inside a column then place text widget after icon button.

Column(
 children:[
  IconButton(
    icon: Icon(
    Icons.send,
    color: Colors.green,
    ),
    onPressed: () {
    localRequestScheduleChange();
    },
    ),
  Text('Send'),
]
)
  • Related