1

I have designed a function to call a number on a pressed icon. But it cannot launch url

 _callMe() async {
 print("Phone +91${store_phone}");
 var uri = 'tel:+91${store_phone}';
 if (await canLaunch(uri)) {
   await launch(uri);
 } else {
   throw 'Could not launch $uri';
 }
}

It Prints the error Unhandled Exception: Could not launch +919919195521

any help guys?

Arpit Jai
  • 123
  • 1
  • 9

1 Answers1

0

Try below code hope its help to you. used url_launcher package

Padding(
  padding: EdgeInsets.only(top: 18.0),
  child: InkWell(
    child: Text(
      ' +91 888-888-8888',
      style: TextStyle(
        fontSize: 15,
        color: Colors.blue,
      ),
    ),
    onTap: () => launch('tel:${8888888888}'),
  ),
)
Ravindra S. Patil
  • 6,553
  • 2
  • 6
  • 23