whatsapp_sender_flutter 0.0.9 copy "whatsapp_sender_flutter: ^0.0.9" to clipboard
whatsapp_sender_flutter: ^0.0.9 copied to clipboard

outdated

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

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:pretty_qr_code/pretty_qr_code.dart';
import 'package:whatsapp_sender_flutter/whatsapp_sender_flutter.dart';

void main() {
  runApp(
    const MaterialApp(
      home: MyApp(),
    ),
  );
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  WhatsAppSenderFlutter whatsAppSenderFlutter = WhatsAppSenderFlutter();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      floatingActionButton: FloatingActionButton(
        child: const Icon(Icons.send),
        onPressed: () async {
          showDialog(
            context: context,
            builder: (context) => AlertDialog(
              content: SingleChildScrollView(
                child: Column(
                  children: [
                    ValueListenableBuilder<String>(
                      valueListenable: whatsAppSenderFlutter.qrCode,
                      builder: (context, value, widget) {
                        return value.isEmpty
                            ? const SizedBox()
                            : PrettyQr(
                                size: 300,
                                data: value,
                                roundEdges: true,
                              );
                      },
                    ),
                    ValueListenableBuilder<String>(
                      valueListenable: whatsAppSenderFlutter.status,
                      builder: (context, value, widget) {
                        return Text(value);
                      },
                    ),
                    ValueListenableBuilder<int>(
                      valueListenable: whatsAppSenderFlutter.success,
                      builder: (context, value, widget) {
                        return Text("$value success");
                      },
                    ),
                    ValueListenableBuilder<int>(
                      valueListenable: whatsAppSenderFlutter.fails,
                      builder: (context, value, widget) {
                        return Text("$value fails");
                      },
                    ),
                  ],
                ),
              ),
            ),
          );
          whatsAppSenderFlutter.fails.value = 0;
          await whatsAppSenderFlutter.sendTo(
            phones: [
              "+391111111111",
              "+391111111111",
              "+391111111111",
            ],
            message: "Hello",
          );
        },
      ),
      appBar: AppBar(
        title: const Text("WhatsApp sender"),
      ),
      body: const Center(
        child: Text("Press send button to start the sending"),
      ),
    );
  }
}
30
likes
0
pub points
76%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, puppeteer

More

Packages that depend on whatsapp_sender_flutter