File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
android/src/main/kotlin/com/mr/flutter/plugin/filepicker Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ object FileUtils {
8181 uri,
8282 DocumentsContract .getTreeDocumentId(uri)
8383 )
84- val dirPath = getFullPathFromTreeUri(uri, activity )
84+ val dirPath = getFullPathFromTreeUri(uri)
8585 if (dirPath != null ) {
8686 finishWithSuccess(dirPath)
8787 } else {
@@ -556,7 +556,7 @@ object FileUtils {
556556 }
557557
558558 @JvmStatic
559- fun getFullPathFromTreeUri (treeUri : Uri ? , con : Context ): String? {
559+ fun getFullPathFromTreeUri (treeUri : Uri ? ): String? {
560560 if (treeUri == null ) {
561561 return null
562562 }
@@ -568,16 +568,14 @@ object FileUtils {
568568 Environment .getExternalStoragePublicDirectory(Environment .DIRECTORY_DOWNLOADS ).path
569569 if (docId == " downloads" ) {
570570 return extPath
571- } else if (docId.matches(" ^ms[df]:.*" .toRegex())) {
572- val fileName = getFileName(treeUri, con)
573- return " $extPath /$fileName "
574571 } else if (docId.startsWith(" raw:" )) {
575572 return docId.split(" :" .toRegex()).dropLastWhile { it.isEmpty() }
576573 .toTypedArray()[1 ]
577574 }
578575 return null
579576 }
580577 }
578+
581579 var volumePath = getPathFromTreeUri(treeUri)
582580
583581 if (volumePath.endsWith(File .separator)) {
Original file line number Diff line number Diff line change @@ -292,7 +292,7 @@ class _FilePickerDemoState extends State<FilePickerDemo> {
292292
293293 setState (() {
294294 _isLoading = true ;
295- _userAborted = false ;
295+ _userAborted = true ;
296296 });
297297 }
298298
You can’t perform that action at this time.
0 commit comments