'Query and list all the files of a given extension on the phones internal and external storage in Flutter?

Is there a way of printing all the files of a given extension say(.pdf, .mobi, .epub) in both internal and external storage.

I am not interested in a file manager. Just want all files and their paths.

Any package suggestions is appreciated. I tried using the file_manager package. But it lacks this specific feature.



Sources

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

Source: Stack Overflow

Solution Source