How to make phone call from Flutter App
A Flutter plugin for launching a URL. Supports iOS, Android, web, Windows, macOS, and Linux.
URL_LAUNCER :
- A Flutter plugin for launching a URL. Supports iOS, Android, web, Windows, macOS, and Linux.
- Using the plugin, we can launch the phone app in mobile devices to make phone call from the Flutter app.
To use the plugin,
$ flutter pub add url_launcher
Now in your Dart code, you can use :
import 'package:url_launcher/url_launcher.dart';
Configuration
iOS : Add any URL schemes passed to canLaunch as LSApplicationQueriesSchemes entries in your Info.plist file.
Android : Starting from API 30 Android requires package visibility configuration in your AndroidManifest.xml otherwise canLaunch will return false. A
Usage for phone call :
void callTo(String url) async {
if(await canLaunch(url)) {
await launch(url);
} else {
print("failed to launch $url");
}
}
callTo("+959790123321");
Pub : Url launcher