makePhoneCall method

dynamic makePhoneCall(
  1. String? mobile,
  2. BuildContext context
)

Implementation

makePhoneCall(String? mobile, BuildContext context) async {
  if (mobile != null && mobile.isNotEmpty && mobile != "0") {
    if (await canLaunch("tel:" + mobile)) {
      await launch("tel:" + mobile);
    } else {
      throw 'Could not launch tel:$mobile';
    }
  } else {
    showToast("Mobile number not found", context, AppColors.appColorBlack85);
  }
}