用的 url_launcher 刚开始在模拟器上一直出不来,以为是格式问题,各种尝试,最后放到手机上出来了 mmp~~
git:https://github.com/flutter/plugins/tree/master/packages/url_launcher
1、引用
url_launcher: any
2、使用
launch(url)
url= tel:xxxxxxxxxx 直接打开系统拨号界面
url_launcher 其他功能:
| 方案 | |
|---|---|
http:<URL>,https:<URL>如http://flutter.io | 在默认浏览器中打开URL |
mailto:<email address>?subject=<subject>&body=<body>,例如mailto:smith@example.org?subject=News&body=New%20plugin | 在默认电子邮件应用中创建电子邮件 |
tel:<phone number>,例如 tel:+1 555 010 999 | 拨打电话以使用默认电话应用程序 |
sms:<phone number>,例如 sms:5550101234 | 使用默认消息传递应用程序发送SMS消息 |

本文介绍 Flutter 中 url_launcher 插件的使用方法及功能,包括如何在默认浏览器中打开 URL、创建电子邮件、拨打电话及发送短信等操作。
3361

被折叠的 条评论
为什么被折叠?



