美文网首页flutter
Flutter调用短信、电话等

Flutter调用短信、电话等

作者: 习惯了_就好 | 来源:发表于2019-05-07 10:35 被阅读2次

    插件地址:https://pub.flutter-io.cn/packages/url_launcher#-readme-tab-

    body: ListView(
              children: <Widget>[
                MyRowText("打电话", () => doCall('tel:+1 555 010 999')),
                MyRowText("发短信", () => doCall('sms:5550101234')),
                //subject 主题 ;body内容
                MyRowText("发邮件", () => doCall('mailto:smith@example.org?subject=News&body=New%20plugin')),
                MyRowText("跳转浏览器", () => doCall('http://www.baidu.com')),
                MyRowText("跳转安卓App", () => doCall('ssbdapp://jump.com/communityhome')),
              ],
            ),
    
    doCall(url) async {
        if (await canLaunch(url)) {
          await launch(url);
        } else {
          throw 'Could not launch $url';
        }
      }
    

    相关文章

      网友评论

        本文标题:Flutter调用短信、电话等

        本文链接:https://www.haomeiwen.com/subject/gnosoqtx.html