在我的flutter项目中,InAppWebView小部件中的每个showDialog小部件都会出现此警告。如何解决此问题?
return InAppWebView(
...
onLongPressHitTestResult: (controller, hitTestResult) async {
if (LongPressAlertDialog.hitTestResultSupported
.contains(hitTestResult.type)) {
var requestFocusNodeHrefResult =
await _webViewController?.requestFocusNodeHref();
if (requestFocusNodeHrefResult != null) {
//Don't use 'BuildContext' across async gaps
showDialog(
context: context,
builder: (context) {
return LongPressAlertDialog(
webViewModel: widget.webViewModel,
hitTestResult: hitTestResult,
requestFocusNodeHrefResult: requestFocusNodeHrefResult,
);
},
);
}
}
},
}
1条答案
按热度按时间c8ib6hqw1#
试试这个: