launchWhatsApp function

Future launchWhatsApp(
  1. String phone
)

Implementation

Future launchWhatsApp(String phone) async {
  final url = Uri.parse('https://wa.me/$phone');
  if (await canLaunchUrl(url)) {
    await launchUrl(url, mode: LaunchMode.externalApplication);
  } else {
    throw 'Could not launch WhatsApp';
  }
}