wc_flutter_share 0.2.0

wc_flutter_share #

A Flutter plugin for sharing file, text and subject at the same time with other applications.

Build Status Author

Note for iOS #

Your flutter's iOS code needs to be in swift. Otherwise you will get error:

=== BUILD TARGET flutter_inappbrowser OF PROJECT Pods WITH CONFIGURATION Debug === The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.

Instead, if you have already a non-swift project, you can check this issue to solve the problem: Friction adding swift plugin to objective-c project.

Note for Android #

Your android support libraries needs to be of androidx. If you want to migrate your android project to androidx, you can take help from Migrating to AndroidX

Usage #

Import: #

import 'package:wc_flutter_share/wc_flutter_share.dart';

Share text: #

    sharePopupTitle: 'Share',  
    subject: 'This is subject',  
    text: 'This is text',  
    mimeType: 'text/plain');

Share file only: #

final ByteData bytes = await rootBundle.load('assets/wisecrab.png');  
await WcFlutterShare.share(
	sharePopupTitle: 'share',  
    fileName: 'share.png',  
    mimeType: 'image/png',  
    bytesOfFile: bytes.buffer.asUint8List());

Share file, text and subject: #

final ByteData bytes = await rootBundle.load('assets/wisecrab.png');  
await WcFlutterShare.share(  
    sharePopupTitle: 'share',  
    subject: 'This is subject',  
    text: 'This is text',  
    fileName: 'share.png',  
    mimeType: 'image/png',  
    bytesOfFile: bytes.buffer.asUint8List());

NOTE: You won't be able to share image and text simultaneously on some applications. It is not a bug of this plugin. Some applications don't support this. I have tested this on Skype, on which is working fine.

Check out the example app in the Repository for further information.

More from Wisecrab: #

  • Form Validators: A plugin which provides utility functions to make form validation easy.

0.0.1 #

  • Initial release

0.0.2 #

  • text and file methods replaced with share method

0.1.0 #

  • path_provider version updated to version ^1.1.0

0.1.1 #

  • kotlin version updated from 1.2.71 to 1.3.21
  • androidx.test:runner version updated from 1.1.1 to 1.2.0
  • androidx.test.espresso:espresso-core version updated from 3.1.1 to 3.2.0
  • androidx.core:core version updated from 1.0.0-rc01 to 1.2.0-alpha02

0.2.0 #

  • iPad support added
  • path_provider version update to ^1.6.0
  • androidx.core:core removed as it was not required


wc_flutter_share_example #

Demonstrates how to use the wc_flutter_share 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:

  wc_flutter_share: ^0.2.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:wc_flutter_share/wc_flutter_share.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 Feb 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5
  • Flutter: 1.12.13+hotfix.7


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
path_provider ^1.6.0 1.6.1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies