openPhoneCall method

  1. @override
Future openPhoneCall({
  1. required String phoneNumber,
})
override

Implementation

@override
Future openPhoneCall({
  required String phoneNumber,
}) async {
  String url = 'tel:$phoneNumber';
  final uri = Uri.parse(url);
  if (!await canLaunchUrl(uri)) {
    throw 'Could not open the phone contact.';
  } else {
    _launch(uri);
  }
}