【问题标题】:Call Phone number Function in FlutterFlutter中拨打电话号码功能
【发布时间】:2022-01-06 05:24:12
【问题描述】:

我设计了一个函数来调用按下图标上的数字。 但它无法启动网址

 _callMe() async {
 print("Phone +91${store_phone}");
 var uri = 'tel:+91${store_phone}';
 if (await canLaunch(uri)) {
   await launch(uri);
 } else {
   throw 'Could not launch $uri';
 }
}

它打印错误 未处理的异常:无法启动 +919919195521

有什么帮助吗?

【问题讨论】:

标签: flutter flutter-layout flutter-dependencies flutter-web flutter-animation


【解决方案1】:

试试下面的代码希望它对你有帮助。使用url_launcher

Padding(
  padding: EdgeInsets.only(top: 18.0),
  child: InkWell(
    child: Text(
      ' +91 888-888-8888',
      style: TextStyle(
        fontSize: 15,
        color: Colors.blue,
      ),
    ),
    onTap: () => launch('tel:${8888888888}'),
  ),
)

【讨论】:

    猜你喜欢
    • 2018-03-09
    • 2016-08-11
    • 2015-01-31
    • 1970-01-01
    • 1970-01-01
    • 2016-03-26
    • 2012-06-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多