简体   繁体   English

如何将包含 html 标签的 web 页面复制到 Flutter 应用程序?

[英]How do I copy a web page including html tags to a Flutter app?

If I select part of a web page (like in the attached picture) and copy it to Microsoft Word, almost all the information will be displayed including the title, hyperlink, and image.如果我将 web 页面的 select 部分(如附图所示)复制到 Microsoft Word 中,将显示几乎所有信息,包括标题、超链接和图像。

But if I paste it to the Flutter app, only plain text is displayed.但如果我将其粘贴到 Flutter 应用程序中,则只显示纯文本。 So my question is how to copy those HTML tags to the Flutter app?所以我的问题是如何将这些 HTML 标签复制到 Flutter 应用程序?

Thanks.谢谢。

You can use flutter_html package, you can find it on the this link => https://pub.dev/packages/flutter_html and this is how you can use it您可以使用flutter_html package,您可以在此链接上找到它=> https://pub.dev/packages/flutter_html这就是您可以使用它的方式

 Future<void> showPrivacyPolicy(BuildContext context) async {
   return showCupertinoModalBottomSheet(
    context: context,
    isDismissible: true,
    builder: (context) => Material(
      child: Column(
       children: [
         AppBar(
           title: Text(
            'PRIVACY POLICY',
             style: TextStyle(color: Colors.white),
           ),
           centerTitle: true,
           backgroundColor: ceruleanTwo,
           elevation: 0,
         ),
         Expanded(
           child: SingleChildScrollView(
             child: Html(
               data: privacyString,
             ),
           ),
         ),
       ],
     ),
    ),
   );
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用路由显示Web应用程序页面时如何为模板标签添加HTML页面 - How do I add an HTML page for template tags when I am using Routes to display web app pages 如何停止CKEditor在内容输出中包含HTML标记? - How do I stop CKEditor including HTML tags in content output? 如何解析包含隐藏标签的HTML页面 - How to parse a HTML page including hidden tags 如何在 Flutter 应用程序中使用 HTML 标签获取输入 - How to get input with HTML tags in flutter app 如何从Webview的页面显示中删除HTML标签? - How do I remove HTML tags from page display in Webview? 如何将整个网页旋转到一定程度,包括页面上的所有元素? - How do I rotate the whole web page to a certain degree including all the elements on the page? How will I host a static HTML page on Azure linux web app? - How will I host a static HTML page on Azure linux web app? 如何动态地将html代码段附加到网页中? - How do I dynamically append html snippets into the web page? 如何修复网页中与脚本相关的HTML标签的不正当中和? - How can I fix improper Neutralization of Script-Related HTML Tags in a Web Page? 如何为我的网页提供HTML嵌入式代码? - How do I provide an HTML embedded code for my web page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM