调用 url_launcher 模块打开外部浏 览器 打开外部应用 拨打电话 发送短信
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart'; class UrlLauncher extends StatefulWidget {
UrlLauncher({Key key}) : super(key: key); _UrlLauncherState createState() => _UrlLauncherState();
} class _UrlLauncherState extends State<UrlLauncher> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('UrlLauncher'),
),
body: Center(
child: Padding(
padding: EdgeInsets.all(20),
child: ListView(children: [
RaisedButton(
child: Text('打开外部浏览器'),
onPressed: () async{
const url = 'https://cflutter.com';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
},
),
SizedBox(height: 10),
RaisedButton(
child: Text('拨打电话'),
onPressed: () async{
var tel = 'tel:10086';
if (await canLaunch(tel)) {
await launch(tel);
} else {
throw 'Could not launch $tel';
} },
),
SizedBox(height: 10),
RaisedButton(
child: Text('发送短信'),
onPressed: () async{
var tel = 'sms:10086';
if (await canLaunch(tel)) {
await launch(tel);
} else {
throw 'Could not launch $tel';
}
},
),
SizedBox(height: 10),
RaisedButton(
child: Text('打开外部应用'),
onPressed: () async{
/*
weixin://
alipays://
*/
var url = 'alipays://';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
} },
)
]),
)));
}
}
调用 url_launcher 模块打开外部浏 览器 打开外部应用 拨打电话 发送短信的更多相关文章
- IOS中调用系统拨打电话发送短信
一.调用打电话界面 [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat ...
- IOS中调用系统的电话、短信、邮件、浏览功能
iOS开发系列--通讯录.蓝牙.内购.GameCenter.iCloud.Passbook系统服务开发汇总 2015-01-13 09:16 by KenshinCui, 26990 阅读, 35 评 ...
- android 中调用接口发送短信
android中可以通过两种方式发送短信 第一:调用系统短信接口直接发送短信:主要代码如下: //直接调用短信接口发短信 SmsManager smsManager = SmsManager.getD ...
- 短信接口调用以及ajax发送短信接口实现以及前端样式
我们短信api用的是云信使平台提供的非免费短信服务:官网提供的demo有两种,分别是function加其调用.class文件加其调用. 在这里我们用class文件加调用: 首先,ThinkPHP里面自 ...
- Linux-C实现GPRS模块发送短信
“GSM模块,是将GSM射频芯片.基带处理芯片.存储器.功放器件等集成在一块线路板上,具有独立的操作系统.GSM射频处理.基带处理并提供标准接口的功能模块.GSM模块根据其提供的数据传输速率又可以分为 ...
- ios调用本地拨打电话,发送短信
电话.短信是手机的基础功能,iOS中提供了接口,让我们调用.这篇文章简单的介绍一下iOS的打电话.发短信在程序中怎么调用. 1.打电话 [[UIApplication sharedApplicat ...
- iOS通过openURL打开原生应用与页面(包括电话,短信,safari等)
[[UIApplication sharedApplication] openURL:url];通过给url不同的值,可以实现调用系统自带 电话/短信/邮箱/浏览器/... 1.调用 电话phone[ ...
- sqlserver能否调用webservice发送短信呢?
上班的时候突然有一个想法,sqlserver能否调用webservice发送短信呢? 经过查找资料,终于找到了解决办法,现将步骤贴到下面: (1)开启sqlserver组件功能,如果不开启这个组件功能 ...
- Linux系统中调用短信猫发送短信(笔记)
1, 拷贝底层串口依赖的librxtxSerial.so到JDK安装路径cp librxtxSerial.so /usr/java/{0}/jre/lib/{1} # {0}: JDK的基础目录,例如 ...
随机推荐
- idea中如何配置git以及在idea中初始化git,并push到码云
一.给idea配置git 打开IDEA,按照路径 Fie-->Settings --> Tools -->Terminal 找到后设置右边的Shell path(自己安装的Git路 ...
- 如何使用Mbp模块构建应用.
上一篇文章https://www.cnblogs.com/mbpframework/p/12073102.html,介绍了一下Mbp的框架.其实这个框架写出来主要是为了学习,当然也可以经过优化运用到实 ...
- P1002 过河卒【dp】
P1002 过河卒 题目描述 棋盘上AAA点有一个过河卒,需要走到目标BBB点.卒行走的规则:可以向下.或者向右.同时在棋盘上CCC点有一个对方的马,该马所在的点和所有跳跃一步可达的点称为对方马的控制 ...
- numpy小结(一)
1.np.zero(10) 创建一个包含10个元素的一维数组 np.ones((10,10)) 创建一个包含10*10个元素1的二维数组 2.np.arange(10,50) ...
- 通过Process启动外部程序
#region Process //声明一个程序类 System.Diagnostics.Process Proc; try { //声明一个程序信息类 System.Diagnostics.Proc ...
- gitlab 更换服务器后访问 Integrations 出现 500 错误
异常问题解决方案:问题:gitlab 更换服务器后访问 Integrations 出现 500 错误解决方案:从原服务器上将 /etc/gitlab/gitlab-secrets.json 复制过来覆 ...
- vue报错 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c ...
- 161.内置User模型的基本使用
User模型 user模型是这个框架的核心部分,他的完整路径是在django.contrib.auth.models.User.对User对象做一个简单的了解. 字段: 内置的User模型有以下字段: ...
- Hackintosh相关资源站
猫叔博客 https://www.maoshu.cc/ 大神RehabMan https://bitbucket.org/RehabMan/ dsdt/ssdt打补丁译文 https://blog.c ...
- sql 按天及上午下午分组
),r.CTime,), then '下午' end as k, count(*) from Record as r left join Channel as c on r.ChannelId=c.I ...