Amitpatil215 / whatsapp_share

Share text, link, image, files to specific whatsapp contact in flutter
https://pub.dev/packages/whatsapp_share
MIT License
10 stars 16 forks source link

Possible to make the phone number optional? #4

Closed AdiLaxman closed 1 year ago

AdiLaxman commented 3 years ago

Thank you for this wonderful plugin. I have a suggestion though... Is it possible to make the phone number optional? So that the user can select the preferred contacts from the contact list in WhatsApp and then hit send? The below code from the pub.dev page of the plugin:

Future<void> shareFile() async {
    await WhatsappShare.shareFile(
      text: 'Whatsapp share text',
      **phone: '911234567890',**
      filePath: [_image1.path, _image2.path],
    );
  }
Amitpatil215 commented 3 years ago

Hey, @AdiLaxman Thanks for the feedback, will definitely consider your suggestion.

Here is the workaround, if you don't want to bypass WhatsApp contact picker, Just send non empty string to the phone.

Future<void> share() async {
    await WhatsappShare.share(
      text: 'Example share text',
      linkUrl: 'https://flutter.dev/',
      phone: '-',
    );
  }
AdiLaxman commented 3 years ago

Oh.. Let me try this out. Thank you for the prompt response.!!