I am trying to open apps like WhatsApp, Twitter and Facebook from inside my flutter app but I get a URL scheme error. Please help! The code I am using is
child: ElevatedButton(
onPressed: () async {
String url =
"https://api.whatsapp.com/send?text=Hello there!";
var encoded = Uri.encodeFull(url);
Uri whatsAppUri = Uri.parse(encoded);
if (await canLaunchUrl(whatsAppUri)) {
await launchUrl(whatsAppUri);
}
},
I get the following error screen-
Please help me find the correct method and URL. Also please help me with Twitter and Facebook as I need to use them as well. Thank You!