簡體   English   中英

樣式 Html Flutter Dart 中的小部件

[英]Styling Html Widget in Flutter Dart

我正在使用 flutter_html package

我在我的 flutter 項目中有這個,我一直在嘗試設置在我的視圖中呈現的結果文本的行高屬性的樣式,但它不起作用,我似乎在任何地方都找不到解決方案。 任何幫助將不勝感激 Html(

              data: detail.length >= 300 ? detail.substring(0, 300) + " ...": detail.substring(0),
               style: {
                "html":Style(
                 /*  wordSpacing: 3, */
                  textAlign: TextAlign.justify,
                 whiteSpace: WhiteSpace.NORMAL
                ),
              },
              )

當前來自flutter_html: ^1.xxHtml()小部件不支持 css 的行高屬性。因此您需要使用來自flutter_widget_from_html: ^0.5.xHtmlWidget()

HtmlWidget(
         htmlData,
         textStyle: TextStyle(height: 1.8)
         )

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM