插件地址:https://github.com/flutter/plugins/tree/master/packages/url_launcher
推荐使用的url插件,很方便,还可以一键打开发送邮箱的界面,还有拨打电话界面,发送短信等。
Scheme
Action
http:<URL>
, https:<URL>
, e.g. http://flutter.io
Open URL in the default browser
mailto:<email address>?subject=<subject>&body=<body>
, e.g. mailto:smith@example.org?subject=News&body=New%20plugin
Create email to in the default email app
tel:<phone number>
, e.g. tel:+1 555 010 999
Make a phone call to using the default phone app
sms:<phone number>
, e.g. sms:5550101234
Send an SMS message to using the default messaging app
如果想拨打电话界面就直接写个:
url = 'tel:+1 555 010 999';//+1 555 010 999是电话号码, // 记得一定要加冒号:,不然出错
import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; void main() { runApp(Scaffold( body: Center( child: RaisedButton( onPressed: _launchURL, child: Text('Show Flutter homepage'), ), ), )); } _launchURL() async { const url = 'https://flutter.io'; if (await canLaunch(url)) { await launch(url); } else { throw 'Could not launch $url'; } }
you can earn extra cash every month with new monetization method.
This is the best adsense alternative for any type of website (they
approve all sites), for more details simply search in gooogle: murgrabia's tools