Whatsapp Bot using Webview and Whatsapp Web Scraping

Whatsapp bot flutter web

Run Whatsapp bot on web natively (within browser without puppeteer)

Getting Started

Add this script tag in web/index.html file inside of head tag

<script src="./assets/packages/whatsapp_bot_flutter_web/assets/wp_bot.js" defer></script>

Install WhatsappBotFlutter extension on chrome, this extension will insert some required js code in whatsapp web which is required for communication

Install using scripty, To install with scripty, open the (link)[(https://scripty.abhisheksatre.com/#/store)] and search for WhatsappBotFlutterCommunicator and install it, that's it this will automatically inject required js in whatsappWeb whenever needed

Or use any extension to inject this code in whatsapp web

const script = document.createElement("script");
script.type = "text/javascript";
script.src = 'https://cdn.jsdelivr.net/gh/rohitsangwan01/whatsapp_bot_flutter_chrome_extension@latest/content.js';

Or manually install extension from here


Run project using : flutter run -d web-server --web-port 8000 --web-hostname, to open in chrome browser where extension is installed

First we have to get WhatsappClient using WhatsappBotFlutterWeb.connect() method

WhatsappClient? whatsappClient = await WhatsappBotFlutterWeb.connect({
  onConnectionEvent: (ConnectionEvent event) {
  onQrCode: (String qr, Uint8List? imageBytes) {
    // use imageBytes to display in flutter : Image.memory(imageBytes)


Add more docs and make it stable


Thanks to wa-js for exporting functions from WhatsApp Web


This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at https://whatsapp.com. "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.


Its just initial version and under development stage, I can't guarantee you will not be blocked by using this method, try to avoid primary whatsapp numbers. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.

Use this package as a library

Depend on it

Run this command:

With Flutter:

 $ flutter pub add whatsapp_bot_flutter_web

This will add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

  whatsapp_bot_flutter_web: ^0.0.1

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:whatsapp_bot_flutter_web/whatsapp_bot_flutter_web.dart'; 

Download details:

Author: rohitsangwan01

Source: https://github.com/rohitsangwan01/whatsapp_bot_flutter

#flutter #whatsapp 

Whatsapp Bot using Webview and Whatsapp Web Scraping
1.55 GEEK