image_share 0.1.0+4

  • Readme
  • Changelog
  • Example
  • Installing
  • 79

image_share #

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

Wraps the ACTION_SEND Intent on Android and UIActivityViewController on iOS.

Usage #

To use the plugin, add image_share as a dependency in your pubspec.yaml file.

On iOS

Add an NSPhotoLibraryAddUsageDescription key to the Info.plist file.

On Android

No configuration to do.

Example #

Import the library via

import 'package:image_share/image_share.dart';

Then invoke the shareFile method anywhere in your Dart code to share a file given its path :

ImageShare.shareFile(<PATH OF YOUR FILE>);

0.1.0+4 #

  • Fixed a problem relative to the declaration of

0.1.0+3 #

  • Breaking change. Migrated dependencies from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library.

0.1.0+2 #

  • fixing problem with Manifest merger relative to the authorities of FileProvider

0.1.0+1 #

  • Reverted path_provider to 0.5.0 to avoid dependency conflict, since 1.1.0 is not adopted yet by other plugins.

0.1.0 #

  • Fixed a problem relative to the unique provider that prevented the plugin to be usable on multiple apps on the same device.
  • Changed path_provider to 1.1.0.

0.0.2 #

Plugin has be rewritten in Objective-C and Java.

0.0.1 #

Initial release.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';
import 'package:image_share/image_share.dart';

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  Future<void> didPressActionButton() async {
    await ImageShare.shareImage(filePath: "assets/image.jpg");
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin example app'),
        ),
        body: new Center(
          child: Image.asset("assets/image.jpg"),
        ),
        floatingActionButton: FloatingActionButton(
            onPressed: () => didPressActionButton(),
            child: Icon(Icons.share)
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  image_share: ^0.1.0+4

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

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

  • Dart: 2.8.4
  • pana: 0.13.14
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because:

  • package:image_share/image_share.dart that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because:

  • package:image_share/image_share.dart that declares support for platforms: android, ios

Package does not support Flutter platform web

Because:

  • package:image_share/image_share.dart that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because:

  • package:image_share/image_share.dart that declares support for platforms: android, ios

Package not compatible with SDK dart

Because:

  • image_share that is a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

5 out of 5 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (path_provider).

Package is getting outdated. (-5.48 points)

The package was last published 55 weeks ago.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
path_provider ^0.5.0 0.5.0+1 1.6.11
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8