flutter_launch 0.0.3 copy "flutter_launch: ^0.0.3" to clipboard
flutter_launch: ^0.0.3 copied to clipboard

outdatedDart 1 only

A Flutter plugin for iOS and Android to open whatsApp from a button.

Flutter launch WhatsApp #

A Flutter plugin for iOS and Android to open whatsApp.

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

<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();
            },
          )
        ),
      ),
    );
  }
}

34
likes
0
pub points
92%
popularity

Publisher

unverified uploader

A Flutter plugin for iOS and Android to open whatsApp from a button.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_launch