Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.
/ cross_share Public archive

Share files and URLs on both Mobile (Android/iOS), Web and Desktop (Windows, macOS, Linux).

License

Notifications You must be signed in to change notification settings

marchdev-tk/cross_share

cross_share

Build GitHub GitHub stars

A Flutter plugin for launching a URL and sharing files in the mobile, web and desktop platforms. Supports iOS, Android, Web, Windows, Linux and macOS. Note: Sharing files supports only on iOS, Android and Web. Desktop support is under development.

THIS PLUGIN IS DISCONTINUED

Getting Started

In order to use this plugin, add dependency in the pubspec.yaml:

cross_share:
    git:
      url: https://github.com/marchdev-tk/cross_share

Add an import to dart file:

import 'package:cross_share/cross_share.dart';

Samples

Web sample:

Web Sample

Mobile sample:

Mobile Sample

Share URL sample:

Share().shareUrl(url: 'tel:0001112223');

Supported URL schemes

The shareUrl method takes a string argument containing a URL. This URL can be formatted using a number of different URL schemes. The supported URL schemes depend on the underlying platform and installed apps.

Common schemes supported:

Scheme Action
http:<URL> , https:<URL>, e.g. http://flutter.dev Open URL in the default browser
mailto:<email address>?subject=<subject>&body=<body>, e.g. mailto:smith@example.org?subject=News&body=New%20plugin Create email to in the default email app
tel:<phone number>, e.g. tel:+1 555 010 999 Make a phone call to using the default phone app
sms:<phone number>, e.g. sms:5550101234 Send an SMS message to using the default messaging app

Share File :

Share().shareFile(
    name: file.name,
    bytes: file.bytes,
    type: file.type,
);

where:

  • name is a name of the file
  • bytes is a byte array of file to share
  • type is a MIME Type of the file to share

Feature requests and Bug reports

Feel free to post a feature requests or report a bug here.