flutter_plugin_openwhatsappad 0.0.1 copy "flutter_plugin_openwhatsappad: ^0.0.1" to clipboard
flutter_plugin_openwhatsappad: ^0.0.1 copied to clipboard

PlatformAndroid

A new plugin project, To open third-party WhatsApp in an app.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_plugin_openwhatsapp/flutter_plugin_openwhatsapp.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example'),
        ),
        body: Center(
          child: IconButton(
            onPressed: () async {
              final flutterPlugin = FlutterPluginOpenwhatsapp();
              var platform = defaultTargetPlatform;
              if (platform == TargetPlatform.android) {
                String? result = await flutterPlugin.openWhatsApp(
                  phoneNumber: '0123456789',
                  text: 'Hi, this is a test message!',
                );
                debugPrint('>>>: $result');
              }
            },
            icon: const Icon(
              Icons.send,
            ),
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
14
downloads

Publisher

unverified uploader

Weekly Downloads

A new plugin project, To open third-party WhatsApp in an app.

Homepage

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface

More

Packages that depend on flutter_plugin_openwhatsappad