Search code examples
flutterflutter-layout

Flutter support rtl


I am starting to work on one big project, So my question is can I change the direction of the listview to RTL,

new ListTile(
      trailing: new Icon(Icons.keyboard_arrow_right),
      onTap: onTab,
      leading: new Icon(Icons.account_circle),
      title: new Text("Test"),
    );

enter image description here


Solution

  • You can specify the direction for any subtree of the UI:

    new Directionality(textDirection: TextDirection.rtl, 
        child: new ListTile(...))
    

    See also https://api.flutter.dev/flutter/widgets/Directionality-class.html