Html widget need to support RTL . LTR
Just use Directionality widget over it and set the text direction to rtl ....I am using it and it works fine :)
Perhaps I'll consider adding an option in the HTML widget. Thanks!
I'm going to leave this as is, for users to implement by following the suggestion provided by ahmadkhedr so that the Widget behaves as expected when wrapped in a Directionality widget.
after version ^0.9.6 Directionality is not working any more.
Code Example:
Directionality(
textDirection:
TextDirection.rtl,
child: Html(
padding: EdgeInsets.symmetric(vertical: 12.0),
data: widget.message.message,
defaultTextStyle: TextStyle(fontSize: 16.0),
onLinkTap: (url) {
_openLink(url);
},
)
Flutter Doctor:
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.475], locale en-US)
• Flutter version 1.5.4-hotfix.2
• Framework revision 7a4c33425d (4 weeks ago), 2019-04-29 11:05:24 -0700
• Engine revision 52c7a1e849
• Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)
Directionality didn't fully help me,
You also need to add customTextAlign as I did.
Html(
data: snapshot.data.data,
customTextAlign: (_)=>TextAlign.right,
),
Most helpful comment
Just use Directionality widget over it and set the text direction to rtl ....I am using it and it works fine :)