share_binary 1.4.0 copy "share_binary: ^1.4.0" to clipboard
share_binary: ^1.4.0 copied to clipboard

This library provides the ability to use OS sharing features while handling binary files in dart code.

share_binary #

This library allows you to use the OS's share function while treating binary files such as images and videos as binary data in dart code.

Usage #

import 'package:share_binary/share_binary.dart';

Future<void> shareImage() async {
  final image = await rootBundle.load('assets/image.png');

  await const ShareBinary().shareBinary(
    bytes: image,
    filename: 'image.png',
    chooserTitle: 'Share image',
  );
}

Future<void> shareVideo() async {
  final video = await rootBundle.load('assets/video.mp4');

  await const ShareBinary().shareBinary(
    bytes: video,
    filename: 'video.mp4',
    chooserTitle: 'Share video',
  );
}
2
likes
160
points
369
downloads

Publisher

unverified uploader

Weekly Downloads

This library provides the ability to use OS sharing features while handling binary files in dart code.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, mime, plugin_platform_interface, web

More

Packages that depend on share_binary