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

outdated

Flutter Lauch

example/lib/main.dart

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 {
    bool whatsapp = await FlutterLaunch.hasApp(name: "whatsapp");

    if (whatsapp) {
      await FlutterLaunch.launchWathsApp(phone: "5534992016100", message: "Hello, flutter_launch");
    } 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();
            },
          )
        ),
      ),
    );
  }
}
34
likes
30
pub points
91%
popularity

Publisher

unverified uploader

Flutter Lauch

Repository (GitHub)
View/report issues

License

GPL-3.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_launch