xxxxxxxxxx
https://www.fluttercampus.com/guide/26/how-to-list-files-folder-from-internal-or-sd-card-storage-in-flutter-app/
xxxxxxxxxx
import 'dart:io';
void main() {
// Specify the directory path
String directoryPath = '/path/to/directory';
// List files in the directory
List<FileSystemEntity> fileList = Directory(directoryPath).listSync();
// Print the file names
fileList.forEach((file) {
print(file.path);
});
}