All Projects → huang-weilong → flutter_file_manager

huang-weilong / flutter_file_manager

Licence: GPL-3.0 License
A flutter version of the file explorer

Programming Languages

dart
5743 projects
objective c
16641 projects - #2 most used programming language
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to flutter file manager

Remote-File-Manager
Server Based GUI File Manager
Stars: ✭ 55 (-48.11%)
Mutual labels:  file-manager
vue-fs
A Vue file management client, complete with a node/express/FS backend.
Stars: ✭ 40 (-62.26%)
Mutual labels:  file-manager
saladin
Dual-pane file manager for Windows.
Stars: ✭ 33 (-68.87%)
Mutual labels:  file-manager
webdir
多账户 文件管理系统 轻量级网盘 配合aria2 可以离线下载 新建文件夹 重命名文件 等文件管理的基本功能
Stars: ✭ 26 (-75.47%)
Mutual labels:  file-manager
file manager
FileManager is a wonderful widget that allows you to manage files and folders, pick files and folders, and do a lot more. Designed to feel like part of the Flutter framework.
Stars: ✭ 38 (-64.15%)
Mutual labels:  file-manager
C-Sharp-Learning-Journey
Some of the projects i made when starting to learn c#, winfroms and wpf
Stars: ✭ 95 (-10.38%)
Mutual labels:  file-manager
vdir
a visual directory browser for plan9
Stars: ✭ 66 (-37.74%)
Mutual labels:  file-manager
directorylister
魔改DirectoryLister支持Markdown,各种优化修改
Stars: ✭ 38 (-64.15%)
Mutual labels:  file-manager
explorer
File manager for Android with Material Design
Stars: ✭ 76 (-28.3%)
Mutual labels:  file-manager
X-Filer-Cross-Platform
📁📁📁 X-Filer Cross-Platform - is a simple File Manager looking like popular browsers 📁📁📁
Stars: ✭ 19 (-82.08%)
Mutual labels:  file-manager
llama
Terminal file manager
Stars: ✭ 306 (+188.68%)
Mutual labels:  file-manager
tfex-rs
A simple terminal UI file manager
Stars: ✭ 29 (-72.64%)
Mutual labels:  file-manager
twilight-commander
A simple console file manager.
Stars: ✭ 16 (-84.91%)
Mutual labels:  file-manager
Curator
A lightweight key-value file manager written in Swift.
Stars: ✭ 14 (-86.79%)
Mutual labels:  file-manager
tagflow
TagFlow is a file manager working with tags.
Stars: ✭ 22 (-79.25%)
Mutual labels:  file-manager
sfm
simple file manager
Stars: ✭ 163 (+53.77%)
Mutual labels:  file-manager
telegram file manager bot
Telegram File Manager Bot
Stars: ✭ 39 (-63.21%)
Mutual labels:  file-manager
clifm
Command Line Interface File Manager
Stars: ✭ 87 (-17.92%)
Mutual labels:  file-manager
php-file-manager
PHP File Manager
Stars: ✭ 44 (-58.49%)
Mutual labels:  file-manager
files
Laravel Enso file management add-on for smoothing out some of common cases found when working with files
Stars: ✭ 15 (-85.85%)
Mutual labels:  file-manager

flutter_file_manager

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

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

void initPathFiles(String path) {
    try {
      setState(() {
        parentDir = Directory(path);
        count = 0;
        sortFiles();
        count = _calculatePointBegin(files);
      });
    } catch (e) {
      print(e);
      print("Directory does not exist!");
    }
  }

打开文件

打开文件需要用到原生的Intent来实现,在dart中打开一个通道方法,将文件路径传给Java层调用

MethodChannel _channel = MethodChannel('openFileChannel');

openFile(String path) {
    final Map<String, dynamic> args = <String, dynamic>{'path': path};
    _channel.invokeMethod('openFile', args);
  }

java代码:

private void openFile(Context context, String path) {
        try {
            if (!path.contains("file://")) {
                path = "file://" + path;
            }
            //获取文件类型
            String[] nameType = path.split("\\.");
            String mimeType = MimeTypeMap.getSingleton().getMimeTypeFromExtension(nameType[1]);

            Intent intent = new Intent();
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setAction(Intent.ACTION_VIEW);
            //设置文件的路径和文件类型
            intent.setDataAndType(Uri.parse(path), mimeType);
            //跳转
            context.startActivity(intent);
        } catch (Exception e) {
            System.out.println(e);
        }
    }

效果图

简书 flutter版的文件管理器
掘金 flutter版的文件管理器
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].