Reputation: 379
I'd like to enable my Flutter App to allow users to get redirected to another app on the phone, like Phone or Mail apps on both Android and IOS.
When they click on:
a phone number => open the Phone app with the number passed into the app.
an email => open the Mail app with the email address passed into the app.
Is this possible? if so what widgets/plug-ins to use?
Upvotes: 0
Views: 432
Reputation: 51316
You can Use this Package : https://pub.dartlang.org/packages/url_launcher
_launchDialer() async {
const url = 'tel:12345678';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
_launchEmailApp() async {
const url = 'mailto:smith@example.org?subject=News&body=New%20plugin';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
Upvotes: 1