1

is it possible to change the MaterialBanner direction to be RTL ?

(so the action button will show on the left side, and the leading icon on the right instead of the default way)

i tried all the solutions mentioned here but none worked,

Shaybc
  • 2,628
  • 29
  • 43

1 Answers1

3

there is a flutter widget that flows up in mind when I read this :

direction to be RTL (so the action button will show on the left side and the leading icon on the right instead of the default way)

it's the Directionnality widget.

literally, the use of it is to change the position of widgets from LTR to RTL and vice-versa.

just wrap you widget like this

Gwhyyy
  • 7,554
  • 3
  • 8
  • 35
  • 2
    thanks for the try, but this solution was part of the link i mentioned and all the solutions there did not work, since a MaterialBanner is not really a widget, but a call to show / hide banner then i cannot wrap, also wrapping the content attribute is not enough since is does not contain the leading icon or the actions array, setting it to the whole app also did not work, and using localization also failed – Shaybc Oct 10 '22 at 21:45