【发布时间】:2021-05-27 06:37:02
【问题描述】:
我正在尝试在 Google Pixel API 30 Emulator 上打开一个链接,但不断出现错误。已尝试清理干净、重新启动的应用程序。
依赖:-
url_launcher: ^6.0.3
代码:-
InkWell(
onTap:() => _launchURL("https://google.com"),
child: Image.asset("assets/images/googleIcon.jpg")
),
_launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
错误:-
Unhandled Exception: Could not launch https://google.com
【问题讨论】:
-
在
_launchURL()中显示您的代码
标签: flutter dart url-launcher