Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web功能请教 #477

Closed
Yxjie opened this issue Jul 12, 2019 · 1 comment
Closed

Web功能请教 #477

Yxjie opened this issue Jul 12, 2019 · 1 comment

Comments

@Yxjie
Copy link

Yxjie commented Jul 12, 2019

怎么拿到加载web界面的title,还有此插件是否有canGoBack方法,不像Demo那样 Appbar的返回按钮只适合返回上一个Flutter界面。底部goback按钮,back到首页后 在点击就没反应了

@hanjianchun
Copy link

可以监听url改变,使用evalJavascript 获取title:
flutterWebViewPlugin.onUrlChanged.listen((url){
flutterWebViewPlugin.evalJavascript("window.document.title").then((result){
title = result;
});
});

此插件我没找到canGoBack方法,我监听url的change事件,如果当前按下返回并且url和我初始打开时的链接一样,就让它关闭,否则调用 flutterWebViewPlugin.goBack();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants