Allows Flutter applications to directly dial a phone number.
- Add
<uses-permission android:name="android.permission.CALL_PHONE"/>
to yourAndroidManifest.xml
- Set
minSdkVersion
to23
in your app-levelbuild.gradle
For Android/iOS:
Future<void> dial() async {
final dialer = await DirectDialer.instance;
await dialer.dial('123-456-7890');
}
For iOS, iPad, macOS:
Future<void> dial() async {
final dialer = await DirectDialer.instance;
// FaceTime video
await dialer.dialFaceTime('123-456-7890', true);
// FaceTime audio
await dialer.dialFaceTime('123-456-7890', false);
}