具有文字右对齐抖动的HTML插件? [英] HTML plugin with text right alignment flutter?

查看:74
本文介绍了具有文字右对齐抖动的HTML插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用flutter_html库中的HTML小部件来显示从某些api获取的一些文章,并且我想将我的文本向右对齐(rtl语言)

这是我的代码

I'm using HTML widget from flutter_html library to show some articles fetched from some api and I want to align my text to the right (rtl language) This my code

                      Html(
                        data: widget.article.postContent,
                        defaultTextStyle: TextStyle(
                          color: ThemeColors.white100,
                        ),
                      ),

我尝试使用Directionality小部件作为父小部件,但是它不起作用。

I have tried to use Directionality widget as parent widget but it doesn't work.

推荐答案

添加带有flutter TextAlign的customTextAlign属性小部件的类属性,如下面的代码

add customTextAlign property with flutter TextAlign class properties to the widget like the below code

 Html(
   customTextAlign: (_) => TextAlign.right,
 ),

这篇关于具有文字右对齐抖动的HTML插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆