Shiekh Faizan
Shiekh Faizan

Reputation: 31

How to launch WhatsApp in flutter web or launch WhatsApp from browser?

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

Answers (2)

justin0060
justin0060

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

Shaf
Shaf

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

Related Questions