Search code examples
flutterdartflutter-dependenciesflutter-animationflutter-test

want to get all files from device storage


for getting all files in passing different extensions. Is there a way to get all extensions files from the file

  files = await fm.filesTree(excludedPaths: [
  "/storage/emulated/0/Android"
], extensions: [
  "jpg",
  "jpeg",
  "jfif",
  "png",
  "zip",
  "mp3",
] 

Solution

  • Just remove the extensions: property.

    files = await fm.filesTree(excludedPaths: ["/storage/emulated/0/Android"])
    

    When you add the extensions property, then you add a filter to only allow those. If you remove it (or set it to null), then all files are added.