share method
Share text message and or file into whatsapp
phone
is optional for Android, mandatory for Web, MacOS, Linux and Windows.
But it will be ignored on iOS.
You need to either set text
and or phone
.
Implementation
Future<bool> share({
WhatsApp type = WhatsApp.standard,
String? phone,
String? text,
XFile? file,
}) {
assert(!(text == null && file == null), "Either set text and or file");
return ShareWhatsappPlatform.instance
.share(type: type, phone: phone, text: text, file: file);
}