ivehement / saf

Flutter plugin that leverages Storage Access Framework (SAF) API to get access and perform the operations on files and folders.
https://pub.dev/packages/saf
MIT License
17 stars 16 forks source link

Sometimes files not getting in realme device (Android 11) #16

Open prinsdha opened 1 year ago

prinsdha commented 1 year ago
Saf saf = Saf("Android/media/com.whatsapp.w4b/WhatsApp Business/Media/.Statuses");
  bool? isSync = await saf.sync();
      if (isSync != null && isSync) {
        List<String>? _paths = await saf.getCachedFilesPath();
        if (_paths != null) {
          loadImage(_paths);
        }

 void loadImage(List<String> paths) {
    imageAssets = paths
        .map((item) => item)
        .where((item) => item.endsWith('.jpg'))
        .toList();
  }

isSync getting null and _paths getting empty after 3-4 days from install app Other device working well but in realme device (Android 11) this problem happen.

sumit-chavla-hra commented 3 days ago

@prinsdha

you can look at the following repository which is compatible with all Android SDKs and uses user privacy-friendly storage permissions.

https://github.com/krupal4/StatusSaver/