Javascript 使用HtmlElementView小部件时如何触发函数?
我试图在以下代码中调用函数(Javascript 使用HtmlElementView小部件时如何触发函数?,javascript,html,flutter,dart,iframe,Javascript,Html,Flutter,Dart,Iframe,我试图在以下代码中调用函数(widget.onTap()) GestureDetector( onTap: () { widget.onTap() }, child: Container( height: 1.9 * widget.height, width: 1.2 * widget.width, child: HtmlElementView(viewType: 'liquid-button', key: UniqueKey(),),
widget.onTap()
)
GestureDetector(
onTap: () {
widget.onTap()
},
child: Container(
height: 1.9 * widget.height,
width: 1.2 * widget.width,
child: HtmlElementView(viewType: 'liquid-button', key: UniqueKey(),),
),
)
我已经注册了我的“液体按钮”
ui.platformViewRegistry.registerViewFactory('liquid-button', (int viewId) {
var element = html.IFrameElement()
..style.border = 'none'
..srcdoc = """
<!DOCTYPE html>
<head>
</head>
<body>
<svg class="liquid-button"
...
"""
return element;
});
ui.platformViewRegistry.registerViewFactory('liquid-button',(int-viewId){
var element=html.iframelement()
…style.border='无'
…srcdoc=“”
如果您将手势检测器
替换为墨水池
?仍然不起作用在onTap中放置一个打印,看看是否被调用。很明显,在询问此问题之前,我已经尝试过了question@Damian你有什么解决办法吗?