share_extend 1.0.5 copy "share_extend: ^1.0.5" to clipboard
share_extend: ^1.0.5 copied to clipboard

outdated

A flutter plugin to share text, image, file with system ui. It is compatible with both andorid and ios.

ShareExtend #

调用系统分享的Flutter组件,支持分享文本、图片、视频和文件

安装 #

dependencies:
  share_extend: "^1.0.5"

导入 #

import 'package:share_extend/share_extend.dart';

使用 #


//分享文本
ShareExtend.share("share text", "text");

//分享图片 (例子中使用了一个image_picker的插件来实现图片的选择)
File f =
    await ImagePicker.pickImage(source: ImageSource.gallery);
ShareExtend.share(f.path, "image");

//分享视频
File f = await ImagePicker.pickVideo(
        source: ImageSource.gallery);
ShareExtend.share(f.path, "video");

//分享文件
Directory dir = await getApplicationDocumentsDirectory();
File testFile = new File("${dir.path}/flutter/test.txt");
if (!await testFile.exists()) {
  await testFile.create(recursive: true);
  testFile.writeAsStringSync("test for share documents file");
}
ShareExtend.share(testFile.path, "file"); 

135
likes
0
pub points
97%
popularity

Publisher

unverified uploader

A flutter plugin to share text, image, file with system ui. It is compatible with both andorid and ios.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, meta

More

Packages that depend on share_extend