flutter_share_plugin 0.1.3+3

  • Readme
  • Changelog
  • Example
  • Installing
  • 81

flutter_share_plugin #

pub package License: MIT

Easily share content like text, image or any file to other apps.

Both Android and iOS platforms are supported, no additional changes are required in native code or projects. Except, the Specific permissions (like Storage Access permission), you'll need to add that in your project manually.

Install plugin: #

Visit https://pub.dev/packages/flutter_share_plugin#-installing-tab-

Import library: #

import 'package:flutter_share_plugin/flutter_share_plugin.dart';

That's it. Now, you are ready to go.

Usage Examples: #

Share only text: #

String text = "Check out this plugin: https://pub.dev/packages/flutter_share_plugin ";
FlutterShare.shareText(text);

Share only file: #

Example 1:

String filePath = bohemianRhapsodySong.absolute.path;

// pass the string as `filePath` parameter
FlutterShare.shareFile(filePath: filePath);

Example 2:

Uint8List bytes = bohemianRhapsodySong.readAsBytes();

// pass the Uint8List data as `bytes` parameter
FlutterShare.shareFile(bytes: bytes);

Share file and text content: #

Example 1:

// use preferred method here to get URI string of the file
String uri = screenshot.absolute.path;
String text = "Transaction Screenshot";

FlutterShare.shareFileWithText(
    textContent: text, filePath: uri);

Example 2:

// use preferred method here to get bytes of the files
Uint8List bytes = screenshot.readAsBytes();
String text = "Transaction Screenshot";

FlutterShare.shareFileWithText(
    textContent: text, bytes: bytes);

Screenshots: #

Share text only #

Share a file with text #

0.1.3+3 #

  • Fixed broken Image links

0.1.3+2 #

  • Resolved File share bug caused by URI changes in android native code
  • Changed internal method structure to allow some additional optional parameters
  • Added more documentation for reference

0.1.3+1 #

  • iOS file share bug-fix
  • improved example app

0.1.2 #

  • minor changes

0.1.1 #

  • plugin documentation update

0.1.0 #

  • Public release of the plugin
  • updated plugin's code according to plugin release guidelines
  • no changes in functionality

0.0.3 #

  • updated plugin's documentation

0.0.2 #

  • Added some examples in the plugin's description

0.0.1 #

  • Initial release.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'my_app.dart';

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

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_share_plugin: ^0.1.3+3

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_plugin/flutter_share_plugin.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
61
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

We analyzed this package on Apr 7, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
path_provider ^1.1.0 1.6.5
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
path_provider_macos 0.0.4
path_provider_platform_interface 1.0.1
platform 2.2.1
plugin_platform_interface 1.0.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
pedantic ^1.0.0