Home > OS >  How can I adjust the location of icon and text in Flutter?
How can I adjust the location of icon and text in Flutter?

Time:10-30

 ElevatedButton.icon(
              onPressed: null,
              label: Text("Close"),
              icon: Icon(Icons.close),
            )

enter image description here

As seen in the picture, the icon is on the left, the text is on the right. How can I do the opposite?

CodePudding user response:

wrap the

ElevatedButton.icon

with

Directionality

and make direction rtl

CodePudding user response:

It may not be the best solution, but you can switch label and icon values.

label: Icon(Icons.close),
icon: Text('Close'),
  • Related