'How to search .stauses folder in flutter

I am developing a WhatsApp status saver in a flutter. The path of .statuses folder in file manager is different for different devices. For Example in my mobile path is

/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses

In some other user the path like

/storage/emulated/0/WhatsApp/Media/.Statuses

I am getting files from this path by using code

 List videoList = [];
    if (!Directory('/storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses').existsSync()) {
      dirVideoExist = true;
    }
    videoList = _videoDir
        .listSync()
        .map((item) => item.path)
        .where((item) => item.endsWith('.mp4'))
        .toList(growable: false);  

So my question is how I search specific folders during runtime of the application in flutter so that I don't need to provide the hardcoded path.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source