DevsOnFlutter / file_manager

FileManager is a wonderful widget that allows you to manage files and folders, pick files and folders, and do a lot more. Designed to feel like part of the Flutter framework.
https://pub.dev/packages/file_manager
BSD 3-Clause "New" or "Revised" License
61 stars 18 forks source link

Android 12 zip,txt,pdf all type of document not showing. #17

Closed arpitweetech closed 1 year ago

arpitweetech commented 2 years ago

in Android 11 and 12 it gives only images and video files and all other types of format files not showing in list please resolve this issue as soon as possible Thanks!.

JobaAdewumi commented 2 years ago

Can you replicate the issue?

arpitweetech commented 2 years ago

Screenshot_20220818-143330

Here is my mobiles Download Directory and when I open the File manager of my Device it shows me all files like all pdf, txt, and all files but when I used this package and open this file manager example app in the list I got only images not all other files.

JobaAdewumi commented 2 years ago

Is it possible you also send the code snippet?

JobaAdewumi commented 2 years ago

I have tried to get files for Android 11 and 12 but because of scoped storage it doesn't even work, how did you go around it?

hardikm9850 commented 1 year ago

Hi @4-alok May I request you to please look into this issue if possible? I will also try to figure out what could be the reason

I am also facing the same issue. The folder contains images, video, and pdf although it doesn't list the pdf file for some reason.

hardikm9850 commented 1 year ago

I made it work by granting files access permission manually i.e from App settings.

If we want to request programmatically then display a dialog conveying why permission is required and upon permission granted, invoke the following code ...

val intent = Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION) intent.addCategory("android.intent.category.DEFAULT") intent.data = Uri.parse("package:$packageName") startActivityForResult(intent, MANAGE_STORAGE_RC)

Edit: You need to put the above code in the Flutter method channel and invoke it from the Flutter code

More about it : here

4-alok commented 1 year ago

@hardikm9850 I would appreciate it if you could include this in the documentation of file_manager

hardikm9850 commented 1 year ago

Apologies for noticing your comment so late.

I see that you have already updated both the documentation and the example.