launchPhoneApp static method

void launchPhoneApp(
  1. BuildContext context, {
  2. required String phoneNumber,
})

Implementation

static void launchPhoneApp(BuildContext context, {required String phoneNumber}) async {
  String phone = 'tel:$phoneNumber';
  if (await canLaunchUrl(Uri.parse(phone))) {
    await launchUrl(Uri.parse(phone));
  } else {
    debugPrint("Could not launch Phone with $phoneNumber");
  }
}