share_plugin_plus 0.0.2+2
share_plugin_plus: ^0.0.2+2 copied to clipboard
A flutter plugin Share to Android System, And return the shared status and shared platform
share_plugin #
A flutter plugin Share to Android System,
Installing #
- Add
share_plugin_plus: ^0.0.2to your pubspec.yaml
Usage #
- share Text
void shareTextImpl() async {
var text = "This is a piece of text used to test the share function";
var result = await SharePlugin.share(text, ShareType.TEXT);
if (kDebugMode) {
print('share result status is ${result.status},share platform is ${result.platform}');
}
}
- share Image
void shareImageImpl() async {
var imagePath = "sdcard/image_1.jpg";
var result = await SharePlugin.share(imagePath, ShareType.IMAGE);
if (kDebugMode) {
print('share result status is ${result.status},share platform is ${result.platform}');
}
}
- share File
void shareFileImpl() async {
var filePath = "sdcard/aaa.pdf";
var result = await SharePlugin.share(filePath, ShareType.FILE);
if (kDebugMode) {
print('share result status is ${result.status},share platform is ${result.platform}');
}
}