【发布时间】:2020-01-11 20:41:41
【问题描述】:
我有来自 Json 的 html 并将其保存在字符串中,然后使用 flutter_widget_from_html 依赖项将 html 视为 webview。
我想在htmlWidget 中获取特定的图像 url onTap 特定图像。
在android中我有onTouchListener,我们可以从那里轻松提取图像,但我不知道如何在Flutter中做到这一点。
Directionality(textDirection: TextDirection.rtl,
child: HtmlWidget("<p><img class="alignnone size-full wp-image-231636" src="http://abc/wp-content/uploads/2019/09/big13-48.jpg" alt="" width="600" height="800" srcset="http://abc/wp-content/uploads/2019/09/big13-48.jpg 600w, http://abc/wp-content/uploads/2019/09/big13-48-450x600.jpg 450w" sizes="(max-width: 600px) 100vw, 600px" /></p>",
webView: true,
),
),
【问题讨论】:
-
您能在此处添加该html字符串吗?
-
@AmitPrajapati 我已经编辑了代码。
标签: flutter flutter-dependencies flutter-test