美文网首页
flutter开发 Dialog中加html报错问题

flutter开发 Dialog中加html报错问题

作者: 罐罐金 | 来源:发表于2023-10-23 16:25 被阅读0次

<p>文字描述<img src=\"图片地址\" alt="" data-href="" style=\"width: 50%;\"/></p>

将HtmlWidget放在Dialog中,iOS端会报错安卓端不会报错,原因是文字和图片处于一行,Dialog中没给宽度,在外边给个宽度就好了

Container(

height:200.w,

  width:200.w,

  child:SingleChildScrollView(

child:GetBuilder(

init:xController,

      builder: (GetxController controller) {

return HtmlWidget(

              "<p>12222ee<img src=\"图片地址\" alt="" data-href="" style=\"width: 50%;\"/></p>",

          // widget.data[xController.index].content ?? '',

          textStyle:TextStyle(fontSize:14.sp, color: AppColors.black3),

        );

      },

    ),

  ),

),

相关文章

网友评论

      本文标题:flutter开发 Dialog中加html报错问题

      本文链接:https://www.haomeiwen.com/subject/jmljidtx.html