native_share 1.0.0

native_share #

A Flutter plugin to share content from your Flutter app via the platform's share dialog.

Wraps the ACTION_SEND Intent on Android and UIActivityViewController on iOS.

iOS support Title,Url,Image(local & remote)

Android support Title,Url,Image(local & remote)

Usage #

To use this plugin, add native_share as a dependency in your pubspec.yaml file.

Example #

Import the library via

import 'package:native_share/native_share.dart';

Then invoke the static share method anywhere in your Dart code

NativeShare.share({'title':'Plugin example app','url':'https://github.com/persenlee/native_share','image':null});

Others #

for http image resource

In iOS Info.plist should add NSAppTransportSecurity for ATS

example

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSAllowsArbitraryLoadsForMedia</key>
    <true/>
    <key>NSAllowsArbitraryLoadsInWebContent</key>
    <true/>
    <key>NSAllowsLocalNetworking</key>
    <true/>
</dict>

0.0.1 #

  • TODO: Describe initial release.

example/README.md

native_share_example #

Demonstrates how to use the native_share plugin.

Getting Started #

import 'package:native_share/native_share.dart';
NativeShare.share({'title':'Plugin example app','url':'https://github.com/persenlee/native_share',
            'image' : 'http://imgsrc.baidu.com/imgad/pic/item/908fa0ec08fa513de63a3ec7376d55fbb2fbd913.jpg'});

Use this package as a library

1. Depend on it

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


dependencies:
  native_share: ^1.0.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:native_share/native_share.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
74
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]
87
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/native_share.dart.

Run flutter format to format lib/native_share.dart.

Dependencies

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