Skip to content

Commit 7656dbd

Browse files
Merge pull request #1811 from daniJimen/feature/remove_unnecesary_code_msd_msf_files
Feature/remove unnecesary code msd msf files
2 parents 1a71293 + bfcafcb commit 7656dbd

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

android/src/main/kotlin/com/mr/flutter/plugin/filepicker/FileUtils.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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)) {

example/lib/src/file_picker_demo.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)