如何在flutter/dart中关闭Launcher web视图



我的问题是如何在创建启动器视图后关闭它?

urlLauncher(String url) async {
if (await canLaunch(url)) {
await launch(url, forceWebView: true);
} else {
throw 'Could not launch $url';
}
}

我找到了一个解决方案此pull请求添加了closeWebView方法,以便可以通过编程方式关闭web视图。要使用pull请求的版本,请在pubspec.yaml:中使用

dependencies:
url_launcher:
git:
url: git://github.com/flutter/plugins.git
path: packages/url_launcher
ref: 2c56dd4cca2f5b85619eaea425baccb1e0600886

检查yaml文件中的缩进,因为这非常重要。。

最新更新