ckot
ckot

Reputation: 359

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

 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?

Upvotes: 0

Views: 91

Answers (2)

hamza aboshhiwa
hamza aboshhiwa

Reputation: 172

wrap the

ElevatedButton.icon

with

Directionality

and make direction rtl

Upvotes: 2

vladzaba
vladzaba

Reputation: 1402

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

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

Upvotes: 0

Related Questions