launchWhatsApp static method
Implementation
static void launchWhatsApp(
BuildContext context, {
required String phoneNumber,
String? msg,
}) async {
String whatsappUrl = "whatsapp://send?phone=$phoneNumber";
if (msg != null) {
whatsappUrl += "&text=$msg";
}
if (await canLaunchUrl(Uri.parse(whatsappUrl))) {
launchUrl(Uri.parse(whatsappUrl));
} else {
debugPrint("Could not launch Email with $phoneNumber");
}
}