advanced_share 0.1.0
advanced_share: ^0.1.0 copied to clipboard

discontinued

Flutter plugin for sharing content and file via native ui for Android

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:advanced_share/advanced_share.dart' show AdvancedShare;

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

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

class _MyAppState extends State<MyApp> {
  final scaffoldKey = new GlobalKey<ScaffoldState>();
  @override
  initState() {
    super.initState();
  }

  void handleResponse(response, {String appName}) {
    if (response == 0) {
      print("failed.");
    } else if (response == 1) {
      print("success");
    } else if (response == 2) {
      print("application isn't installed");
      if (appName != null) {
        scaffoldKey.currentState.showSnackBar(new SnackBar(
          content: new Text("${appName} isn't installed."),
          duration: new Duration(seconds: 4),
        ));
      }
    }
  }

  void generic() {
    AdvancedShare.generic(msg: "Hello", url: BASE64_IMAGE).then((response) {
      handleResponse(response);
    });
  }

  void whatsapp() {
    AdvancedShare
        .whatsapp(msg: "It's okay :)", url: BASE64_IMAGE)
        .then((response) {
      handleResponse(response, appName: "Whatsapp");
    });
  }

  void gmail() {
    AdvancedShare
        .gmail(subject: "Advanced Share", msg: "Mail body", url: BASE64_IMAGE)
        .then((response) {
      handleResponse(response, appName: "Gmail");
    });
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Advanced Share',
      home: new Scaffold(
          key: scaffoldKey,
          appBar: new AppBar(
            title: new Text('Advanced Share example app'),
          ),
          body: new Column(
            children: <Widget>[
              new ListTile(
                title: new Text("Generic Share"),
                onTap: generic,
              ),
              new ListTile(
                title: new Text("Whatsapp Share"),
                onTap: whatsapp,
              ),
              new ListTile(
                title: new Text("Gmail Share"),
                onTap: gmail,
              ),
            ],
          )),
    );
  }
}

const String BASE64_IMAGE =
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAaXklEQVR4nO2deXAU17XGBUbY7yUvVUmV817FVanKq/cwCEmgbbQvI4lNSAIhCeLE2I6dx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xqu1GUoJBZCkwUtthl+d2uXtxYnuf+DwVx9ix9n9MH/xJl75bCvWnngVa068ipc/24rWL3bg9dNWWM+/jQ8dn+LLgYshzflDnYO8hChGt5wZDSUkQJKUxdnwQYZpkr8WSQ34yvVmwVWw8TUlH4kSGqAraehlOhQoaZkPRziwikG/x8urNkZ7gWK86l8SIF2jJx0gXaqkA6RLlXSAdKmSDpAuVdIB0qVKOkC6VEkHSJcq6QDpUiUdIF2qpAOkS5V0gHSpkg6QLlXSAdKlSjpAulRJB0iXKukA6VIlHSBdqqQDpEuVdIB0qZIOkC5V0gHSpUo6QLpUSQdIlyr9P9I5w1vj/IpkAAAAAElFTkSuQmCC";
0
likes
0
pub points
47%
popularity

Flutter plugin for sharing content and file via native ui for Android

Repository (GitHub)
View/report issues

Documentation

API reference

License

LICENSE

Dependencies

flutter

More

Packages that depend on advanced_share