whatsapp_launch 0.2.3 copy "whatsapp_launch: ^0.2.3" to clipboard
whatsapp_launch: ^0.2.3 copied to clipboard

DISCONTINUED, USE URL_LAUNCHER INSTEAD, this packages was a use of flutter_launch with some fixes

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:whatsapp_launch/whatsapp_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 {
    bool whatsapp = await WhatsappLaunch.hasApp(name: "whatsapp");

    if (whatsapp) {
      await WhatsappLaunch.launchWathsApp(
          phone: "5534992016545", message: "Hello");
    } else {
      print("Whatsapp não instalado");
    }
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: new Text('Plugin example app'),
        ),
        body: Center(
            child: FlatButton(
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                "Whatsapp",
              )
            ],
          ),
          onPressed: () {
            whatsAppOpen();
          },
        )),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

DISCONTINUED, USE URL_LAUNCHER INSTEAD, this packages was a use of flutter_launch with some fixes

Repository (GitHub)
View/report issues

License

GPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on whatsapp_launch