Skip to content

huang-weilong/flutter_file_manager

Repository files navigation

flutter_file_manager

一个flutter版本的文件管理器,查看SD卡内的文件(android)

列出当前文件夹下所有的文件、文件夹

Directory currentDir = Directory(path);
List<FileSystemEntity> _files = [];
List<FileSystemEntity> _folder = [];
// 遍历所有文件/文件夹
for (var v in currentDir.listSync()) {
 // 去除以 .开头的文件/文件夹
 if (p.basename(v.path).substring(0, 1) == '.') {
   continue;
 }
 if (FileSystemEntity.isFileSync(v.path))
   _files.add(v);
 else
   _folder.add(v);
}

打开文件

使用open_file: 3.2.1插件

OpenFile.open(file.path);

效果图

About

A flutter version of the file explorer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published