Flutter使用flutter_html加載HTML

安裝套件

flutter_html

dependencies:
  flutter_html: ^1.3.0

添加依賴

import 'package:flutter_html/flutter_html.dart';

使用方法

在data裡面寫入html即可。

Html(
  data: """<div>
        <h1>Demo Page</h1>
        <p>This is a fantastic product that you should buy!</p>
        <h3>Features</h3>
        <ul>
          <li>It actually works</li>
          <li>It exists</li>
          <li>It doesn't cost much!</li>
        </ul>
        <!--You can pretty much put any html in here!-->
      </div>""",
);

這是我使用html呈現的農委會的農業新聞表格。

html Flutter使用flutter_html加載HTML
4e52d54f6bc42abb41d26eb5b0df6517?s=250&d=wavatar&r=g Flutter使用flutter_html加載HTML
0 0 評分數
Article Rating
訂閱
通知
guest
0 Comments
在線反饋
查看所有評論