koji-1009 / share_binary

Home Page:https://pub.dev/packages/share_binary

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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> share() async {
  final image = await rootBundle.load('assets/image.png');
  final video = await rootBundle.load('assets/video.mp4');

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

  // Share video
  await const ShareBinary().shareBinary(
    bytes: video,
    filename: 'video.mp4',
    chooserTitle: 'Share video',
  );
}

About

https://pub.dev/packages/share_binary

License:MIT License


Languages

Language:Dart 45.0%Language:Kotlin 19.1%Language:Swift 19.0%Language:Ruby 9.3%Language:HTML 7.5%Language:Objective-C 0.2%