【发布时间】:2018-10-23 19:17:45
【问题描述】:
在 Flutter 中,使用 url_launcher(FIG A)将用户带到一个网站很容易。我正在寻找一种在完成/失败时返回 HTTP 状态代码的方法。理想情况下,这将在文本输出的字符串中返回。
图一;
_launchURL() async {
const url = 'https://google.com/';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
谢谢
【问题讨论】:
标签: http dart flutter http-status-codes