当用户在Webview中打开某些页面时,我正在尝试执行一些UI更改,但是navigationDelegate
和onPageFinished
都没有对URL更改做出反应。
WebView(
initialUrl: 'example.com',
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (WebViewController webViewController) {
_controller.complete(webViewController);
},
navigationDelegate: (NavigationRequest request) {
print(">>>> ${request.url}");
return NavigationDecision.navigate;
},
onPageFinished: (String url) {
print('>>>> Page finished loading: $url');
},
)
是否可以使用webview处理单页Web应用?