【问题标题】:How to load a HTML in String to WebView in Flutter如何将字符串中的 HTML 加载到 Flutter 中的 WebView
【发布时间】:2020-09-01 09:09:45
【问题描述】:

我有一些 HTML 代码在 String 变量中,而不是在文件中。我想在 WebView 上加载这个 String-HTML

【问题讨论】:

    标签: html string flutter webview webview-flutter


    【解决方案1】:

    使用这个包flutter_html: ^1.0.0

    import 'package:flutter_html/flutter_html.dart';
    
    SingleChildScrollView(
           child: Html(
                   data: "<div></div>", // Your Html code over here
                    padding: EdgeInsets.all(8.0),
                  ));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-28
      • 1970-01-01
      • 2019-08-13
      • 2019-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-01
      相关资源
      最近更新 更多