Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShareExtend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
ShareExtend
Commits
6f87f891
Commit
6f87f891
authored
5 years ago
by
zhouteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update pubspec and readme
parent
4e42bd9e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
8 deletions
+35
-8
CHANGELOG.md
CHANGELOG.md
+5
-0
README-en.md
README-en.md
+14
-3
README.md
README.md
+15
-4
pubspec.yaml
pubspec.yaml
+1
-1
No files found.
CHANGELOG.md
View file @
6f87f891
## 1.1.1
*
add option param "share panel title" on android
*
add option param "subject" on both android and ios
*
update sample code with latest image_picker plugin version that fixed video picker bugs
## 1.1.0
*
添加多图,多文件分享功能
*
合并image_picker在ios13中选取视频不可用的补丁
...
...
This diff is collapsed.
Click to expand it.
README-en.md
View file @
6f87f891
...
...
@@ -12,7 +12,7 @@ First, add `share_extend` as a dependency in your pubspec.yaml file.
```
dependencies:
share_extend: "^1.1.
0
"
share_extend: "^1.1.
1
"
```
### iOS
...
...
@@ -45,7 +45,7 @@ import 'package:share_extend/share_extend.dart';
```
//share text
ShareExtend.share("share text", "text");
ShareExtend.share("share text", "text"
,"android share panel title","share subject"
);
//share image
File f =
...
...
@@ -71,9 +71,20 @@ _shareMultipleImages() async {
List<Asset> assetList = await MultiImagePicker.pickImages(maxImages: 5);
var imageList = List<String>();
for (var asset in assetList) {
imageList.add(await asset.filePath);
String path =
await _writeByteToImageFile(await asset.getByteData(quality: 30));
imageList.add(path);
}
ShareExtend.shareMultiple(imageList, "image");
}
Future<String> _writeByteToImageFile(ByteData byteData) async {
Directory dir = await getApplicationDocumentsDirectory();
File imageFile = new File(
"${dir.path}/flutter/${DateTime.now().millisecondsSinceEpoch}.png");
imageFile.createSync(recursive: true);
imageFile.writeAsBytesSync(byteData.buffer.asUint8List(0));
return imageFile.path;
}
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
README.md
View file @
6f87f891
...
...
@@ -10,7 +10,7 @@ Language: [English](https://github.com/zhouteng0217/ShareExtend/blob/master/READ
```
dependencies:
share_extend: "^1.1.
0
"
share_extend: "^1.1.
1
"
```
### iOS
...
...
@@ -42,7 +42,7 @@ import 'package:share_extend/share_extend.dart';
```
//分享文本
ShareExtend.share("share text", "text");
ShareExtend.share("share text", "text"
,"android share panel title","share subject"
);
//分享图片 (例子中使用了一个image_picker的插件来实现图片的选择)
File f =
...
...
@@ -63,14 +63,25 @@ if (!await testFile.exists()) {
}
ShareExtend.share(testFile.path, "file");
//
/分享多图
//
分享多图(借助了MultiImagePicker来多选获取图片图片,由于该库没有提供文件路径,因此demo里面先将图片保存为图片再调用分享)
_shareMultipleImages() async {
List<Asset> assetList = await MultiImagePicker.pickImages(maxImages: 5);
var imageList = List<String>();
for (var asset in assetList) {
imageList.add(await asset.filePath);
String path =
await _writeByteToImageFile(await asset.getByteData(quality: 30));
imageList.add(path);
}
ShareExtend.shareMultiple(imageList, "image");
}
Future<String> _writeByteToImageFile(ByteData byteData) async {
Directory dir = await getApplicationDocumentsDirectory();
File imageFile = new File(
"${dir.path}/flutter/${DateTime.now().millisecondsSinceEpoch}.png");
imageFile.createSync(recursive: true);
imageFile.writeAsBytesSync(byteData.buffer.asUint8List(0));
return imageFile.path;
}
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
pubspec.yaml
View file @
6f87f891
name
:
share_extend
description
:
A Flutter plugin for Android and iOS for sharing text, image, video and file with system ui.
version
:
1.1.
0
version
:
1.1.
1
author
:
zhouteng <qfszyq@gmail.com>
homepage
:
https://github.com/zhouteng0217/ShareExtend
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment