flutter_share_me 0.6.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 95

flutter_share_me #

pub package

Flutter Plugin for sharing contents to social media.

You can use it share to Facebook , WhatsApp , Twitter And System Share UI. Support Url and Text.

Only Android because I don't have a Mac.

Note: This plugin is still under development, and some APIs might not be available yet. Feedback and Pull Requests are most welcome!

Getting Started #

add flutter_share_me as a dependency in your pubspec.yaml file.

Please check the latest version before installation.

    sdk: flutter
  # add flutter_ScreenUtil
  flutter_share_me: ^0.4.0

Usage #

Add the following imports to your Dart code: #

import 'package:flutter_share_me/flutter_share_me.dart';

Add facebook id #

Add "facebook app id" to the application tag of AndroidManifest.xml

       //add this 
            android:value="@string/facebook_app_id" />

Methods #

shareToFacebook({String msg, String url}) #

shareToTwitter({String msg, String url}) #

shareToWhatsApp({String msg,String base64Image}) #

shareToSystem({String msg}) use system share ui #

These methods will return "success" if they successfully jump to the corresponding app.

String msgText message
String urlUrl url
String base64ImageImage base64

Example #

           width: double.infinity,
           child: Column(
             crossAxisAlignment: CrossAxisAlignment.center,
             children: <Widget>[
                 height: 312,
                 width: 175.3,
                 fit: BoxFit.fill,
                 gaplessPlayback: true,
               SizedBox(height: 30),
                 child: Text('share to twitter'),
                 onPressed: () async {
                   var response = await FlutterShareMe().shareToTwitter(
                       url: 'https://github.com/lizhuoyuan', msg: msg);
                   if (response == 'success') {
                     print('navigate success');
                 child: Text('share to shareWhatsApp'),
                 onPressed: () {
                       .shareToWhatsApp(base64ImageUrl: base64Image, msg: msg);
                 child: Text('share to shareFacebook'),
                 onPressed: () {
                       url: 'https://github.com/lizhuoyuan', msg: msg);
                 child: Text('share to System'),
                 onPressed: () async {
                   var response = await FlutterShareMe().shareToSystem(msg: msg);
                   if (response == 'success') {
                     print('navigate success');

0.6.0 #

Solve the provider conflict problem

0.5.0 #

change Key "base64ImageUrl" to "base64Image".

0.4.0 #

Support sharing pictures to whatsapp

0.3.1 #

Allow developers to enter their own facebook id Delete useless code

0.3.0 #

Allow developers to enter their own facebook id

0.2.1 #

Fix issue #5

0.2.0 #

Migrated to AndroidX

0.0.1 #

  • TODO: Describe initial release.


flutter_share_me_example #

Demonstrates how to use the flutter_share_me plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_share_me: ^0.6.0

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_share_me/flutter_share_me.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Oct 18, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8