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
8f546a6c
Commit
8f546a6c
authored
5 years ago
by
zhouteng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update sample code
parent
858342a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
6 deletions
+12
-6
README-en.md
README-en.md
+3
-1
README.md
README.md
+3
-1
example/lib/main.dart
example/lib/main.dart
+6
-4
No files found.
README-en.md
View file @
8f546a6c
...
...
@@ -58,7 +58,9 @@ File f = await ImagePicker.pickVideo(
ShareExtend.share(f.path, "video");
//share file
Directory dir = await getApplicationDocumentsDirectory();
Directory dir = Platform.isAndroid
? await getExternalStorageDirectory()
: await getApplicationDocumentsDirectory();
File testFile = new File("${dir.path}/flutter/test.txt");
if (!await testFile.exists()) {
await testFile.create(recursive: true);
...
...
This diff is collapsed.
Click to expand it.
README.md
View file @
8f546a6c
...
...
@@ -55,7 +55,9 @@ File f = await ImagePicker.pickVideo(
ShareExtend.share(f.path, "video");
//分享文件
Directory dir = await getApplicationDocumentsDirectory();
Directory dir = Platform.isAndroid
? await getExternalStorageDirectory()
: await getApplicationDocumentsDirectory();
File testFile = new File("${dir.path}/flutter/test.txt");
if (!await testFile.exists()) {
await testFile.create(recursive: true);
...
...
This diff is collapsed.
Click to expand it.
example/lib/main.dart
View file @
8f546a6c
...
...
@@ -65,7 +65,7 @@ class _MyAppState extends State<MyApp> {
),
RaisedButton
(
onPressed:
()
{
_share
ApplicationDocuments
File
();
_share
Storage
File
();
},
child:
Text
(
"share file"
),
),
...
...
@@ -106,9 +106,11 @@ class _MyAppState extends State<MyApp> {
return
imageFile
.
path
;
}
///share the documents file
_shareApplicationDocumentsFile
()
async
{
Directory
dir
=
await
getApplicationDocumentsDirectory
();
///share the storage file
_shareStorageFile
()
async
{
Directory
dir
=
Platform
.
isAndroid
?
await
getExternalStorageDirectory
()
:
await
getApplicationDocumentsDirectory
();
File
testFile
=
File
(
"
${dir.path}
/flutter/test.txt"
);
if
(!
await
testFile
.
exists
())
{
await
testFile
.
create
(
recursive:
true
);
...
...
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