Flutter_html: Support Rtl (Arabic Text)

Created on 29 Mar 2019  Â·  5Comments  Â·  Source: Sub6Resources/flutter_html

Html widget need to support RTL . LTR

enhancement

Most helpful comment

Just use Directionality widget over it and set the text direction to rtl ....I am using it and it works fine :)

All 5 comments

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, ),

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bhanuka96 picture bhanuka96  Â·  4Comments

hunglv21 picture hunglv21  Â·  5Comments

Nijinsha picture Nijinsha  Â·  4Comments

The-Redhat picture The-Redhat  Â·  3Comments

raLaaaa picture raLaaaa  Â·  3Comments