Reputation: 31
How to launch WhatsApp in Flutter web or launch WhatsApp from browser in Flutter or suggest any package from pub.dev?
Upvotes: 2
Views: 2784
Reputation: 93
You need the url_launcher https://pub.dev/packages/url_launcher. Import the package in you're yaml and then in your .dart
Then use the launch function with the WhatsApp URL: launch('whatsapp://send?phone=$phonenumber')
For the launching the WhatsApp Website use launch('https://web.whatsapp.com')
Upvotes: 0
Reputation: 173
You can give an anchor with href to https://api.whatsapp.com/send/?phone=(phone_number)
For full code
<a href="https://api.whatsapp.com/send/?phone=6281144441111&text=Hello">Send Hi to me</a>
Note:
Make sure you give your country code without (+).
for example 6281144441111
Upvotes: 3