Use the plugin.
> url_launcher
Using the following link : https://api.whatsapp.com/send?phone=XXXXXXXXXXX (In place of the Xs type the phone number of the person you want to contact, including the country code, but without the + sign.)
RaisedButton(
onPressed: () async => await launch(
"https://wa.me/${number}?text=Hello"),,
child: Text('Open Whatsapp'),
),
**Alternatively**
You can use this other plugin.
> whatsapp_unilink
The whatsapp_unilink package helps you build HTTP links and provides you with an idiomatic Dart interface that:
import 'package:whatsapp_unilink/whatsapp_unilink.dart';
import 'package:url_launcher/url_launcher.dart';
launchWhatsApp() async {
final link = WhatsAppUnilink(
phoneNumber: '+001-(555)1234567',
text: "Hey! I'm inquiring about the apartment listing",
);
await launch('$link');
}
Use the plugin.
> [url_launcher][1]
Using the following link : https://api.whatsapp.com/send?phone=XXXXXXXXXXX (In place of the Xs type the phone number of the person you want to contact, including the country code, but without the + sign.)
> RaisedButton(
> onPressed: () async => await launch(
> "https://wa.me/${number}?text=Hello"),,
> child: Text('Open Whatsapp'),
> ),
**Alternatively**
You can use this other plugin.
> [whatsapp_unilink][2]
The whatsapp_unilink package helps you build HTTP links and provides you with an idiomatic Dart interface that:
> import 'package:whatsapp_unilink/whatsapp_unilink.dart';
> import 'package:url_launcher/url_launcher.dart';
>
> launchWhatsApp() async {
> final link = WhatsAppUnilink(
> phoneNumber: '+001-(555)1234567',
> text: "Hey! I'm inquiring about the apartment listing",
> );
> await launch('$link');
> }
[1]: https://pub.dev/packages/url_launcher
[2]: https://pub.dev/packages/whatsapp_unilink