美文网首页
7.拨打电话操作

7.拨打电话操作

作者: 冰点雨 | 来源:发表于2019-12-23 17:49 被阅读0次

url_launcher的简介
官方介绍:

A Flutter plugin for launching a URL in the mobile platform. Supports iOS and Android.

意思是用于在移动平台中启动URL的Flutter插件,适用于IOS和Android平台。他可以打开网页,发送邮件,还可以拨打电话。
github地址:https://github.com/flutter/plugins/tree/master/packages/url_launcher

在pubspec.yaml文件里注册依赖,并保存下载包。请注意使用最新版。

url_launcher: ^5.0.1

在需要使用的页面在使用import引入具体的url_launcher包。

import 'package:url_launcher/url_launcher.dart';

打电话

void _launchURL() async {
    String url = 'tel:'+leaderPhone;
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }

相关文章

  • 7.拨打电话操作

    url_launcher的简介官方介绍: A Flutter plugin for launching a URL...

  • iOS CTCallCenter获取拨打电话后的事件

    项目中需要实现再打电话时保存编辑过的内容,这就需要对拨打电话时进行监听操作,使用CTCallCenter实现对拨打...

  • 微信小程序07:拨打电话

    资料 拨打电话: wx.makePhoneCall(Object object)显示操作菜单:wx.showAct...

  • 【卡黄】《难过时,跳跳舞》7

    7. “您拨打的电话不在服务区,请您稍后再拨…” 李艺彤又挂断了电话,窗外的雪都化了,在这呆的太久了,她都忘了春天...

  • 拨打电话

    NSString *callPhone = [NSString stringWithFormat:@"telpro...

  • 拨打电话

    创建一个UIWebView来加载URL,拨完后能自动回到原应用if (_webView == nil) {_web...

  • 拨打客服电话

    //拨打客服 NSURL *url = [NSURL URLWithString:@"tel://40096995...

  • 拨打完电话

    1,这种方法,拨打完电话回不到原来的应用,会停留在通讯录里,而且是直接拨打,不弹出提示NSMutableStrin...

  • 拨打电话

    使用这种方式拨打电话时,可以使得用户结束通话后自动返回到应用: 使用这种方式拨打电话时,直接拨打且不能自动返回到应...

  • 拨打电话

    拨打之前判断硬件是否提供该服务 public static void callPhone(String phone...

网友评论

      本文标题:7.拨打电话操作

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