Skip to content
Plugin flutter to launch whatsapp
Branch: master
Clone or download
Latest commit ba597b9 May 21, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea fix May 20, 2019
android fix May 20, 2019
example fix May 20, 2019
ios fix May 20, 2019
lib fix May 20, 2019
.gitignore fix May 20, 2019
.metadata fix May 20, 2019
CHANGELOG.md fix May 20, 2019
LICENSE fix May 20, 2019
README.md fix May 20, 2019
flutter_launch.iml fix May 20, 2019
pubspec.lock fix May 20, 2019
pubspec.yaml fix May 20, 2019

README.md

Flutter launch WhatsApp

A Flutter plugin for iOS and Android to open whatsApp.

pub package

Installation

First, add flutter_launch_whatsapp as a dependency in your pubspec.yaml file.

iOS

Add the following entry to your Info.plist file, located in /ios/Runner/Info.plist:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>whatsapp</string>
</array>

Android

n/a

Example

import 'package:flutter/material.dart';
import 'package:flutter_launch/flutter_launch.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  @override
  initState() {
    super.initState();
  }

  void whatsAppOpen() async {
    await FlutterLaunch.launchWathsApp(phone: "5534992016545", message: "Hello");
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: new Center(
          child: FlatButton(
            child: Text("Open WhatsApp"),
            onPressed: () {
              whatsAppOpen();
            },
          )
        ),
      ),
    );
  }
}
You can’t perform that action at this time.