Search packages, repositories and app categories

Package detailsv0.2.0

whatsapp_sender_flutter

WhatsApp Sender Flutter is an unofficial API for Flutter to send bulk messages in Whatsapp

macOSWindowsLinux
30-day downloads
45
Likes
31
Pub points
125

Install package

flutter pub add whatsapp_sender_flutter

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

WhatsApp Sender Flutter is an unofficial Flutter package that enables developers to send bulk WhatsApp messages programmatically. It integrates with the WhatsApp Web API through a browser automation approach, allowing message delivery without official WhatsApp API access. Designed for desktop platforms including macOS, Windows, and Linux, it's useful for automated notifications, reminders, or marketing campaigns. The package requires manual setup and relies on an active WhatsApp Web session. While functional, it operates outside official WhatsApp guidelines, which may pose risks of account suspension.

Use cases

  • Bulk notification systems
  • Automated reminders
  • Marketing campaign tools
  • Customer outreach
  • Event invitations

Key features

  • Bulk message sending
  • Desktop platform support
  • Browser automation backend
  • Simple integration with Flutter
  • Session persistence

Suitable for

  • Developers building desktop apps
  • Teams needing mass messaging
  • Non-commercial automation projects
  • Prototyping WhatsApp integrations

Considerations

  • Unofficial API usage
  • Risk of account bans
  • Manual session setup required
  • Limited to desktop platforms
  • No official WhatsApp support

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

WhatsApp Sender Flutter

pub package pub points pub popularity pub likes

WhatsApp Sender Flutter is an unofficial API for Flutter to send bulk messages in Whatsapp. It's not recommended using it in your company or for marketing purpose.

Buy Me A Book

Thanks to rohitsangwan01 for reference!

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  ...
  whatsapp_sender_flutter: latest

Import it:

import 'package:whatsapp_sender_flutter/whatsapp_sender_flutter.dart';

Configuration

For the first usage, wait for the automatic download of the .local-chromium folder in your project root. Without this folder the package will not work,this is because this package is based on puppeteer.

Basic usage

The process for sending messages is like for WhatsApp Web:

  1. Scan the qr code
  2. Start the sending
Send text message

After you have scanned the code, you can start the sending campaign.

All phones must contain the international prefix!

   await WhatsAppSenderFlutter.send(
         phones: [ "391111111", "391111111", "391111111"],
         message: "Hello",
   );
Send file message

After you have scanned the code, you can start the sending campaign.

All phones must contain the international prefix!

   await WhatsAppSenderFlutter.send(
         phones: [ "391111111", "391111111", "391111111"],
         message: "Hello",
         file: File("path-to-file.pdf"),
   );
Listen changes

New functions for listen changes:

  1. onEvent(WhatsAppSenderFlutterStatus status), usethis function to listen the sending status
  2. onQrCode(String qrCode), use this function to intercept the qrCode
  3. onSending(WhatsAppSenderFlutterCounter counter), use this function to count the number of successful or unsuccessful submissions.
  4. onError(WhatsAppSenderFlutterErrorMessage errorMessage), use this feature to catch errors while sending
   await WhatsAppSenderFlutter.send(
        phones: [ "391111111", "391111111", "391111111"],
        message: "Hello",
        file: File("path-to-file.pdf"),
        onEvent: (WhatsAppSenderFlutterStatus status) {
          print(status);
        },
        onQrCode: (String qrCode) {
          print(qrCode);
        },
        onSending: (WhatsAppSenderFlutterCounter counter) {
          print(counter.success.toString());
          print(counter.fails.toString());
        },
        onError: (WhatsAppSenderFlutterErrorMessage errorMessage) {
          print(errorMessage);
        },
   );

To know in detail the possible states of WhatsAppSenderFlutterStatus, WhatsAppSenderFlutterCounter, WhatsAppSenderFlutterErrorMessage read documentation

Save your session
   await WhatsAppSenderFlutter.send(
         phones: [ "391111111", "391111111", "391111111"],
         message: "Hello",
         savedSessionDir: "./userData"
   );

To save the session you must indicate a folder name in savedSessionDir.

If you save the session you will no longer have to scan the qr code !

Do not indicate savedSessionDir if you want to be asked to scan the qr code at each sending.

To Do

  • Send text message ✔️
  • Multi session support ✔️
  • Send files ✔️
  • Native mobile support (Android, IOS)

License

MIT

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.