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.

Overview

File Manager

FileManager-Banner

GitHub GitHub code size in bytes GitHub top language GitHub language count GitHub tag (latest by date) GitHub issues

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.

Compatibility

  Android
  Linux
  Windows (in progress)
  Web
  MacOS (active issue: MacOS support)
  iOS (active issue: iOS support)

Usage

Make sure to check out examples for more details.

Installation

Dependencies Add the following line to pubspec.yaml:

dependencies:
  file_manager: ^1.0.0

Give storage permission to application

Android: Beside needing to add WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE to your android/app/src/main/AndroidManifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.xxx.yyy">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
...
</manifest>

also add for Android 10

    <application
      android:requestLegacyExternalStorage="true"   
      ...

You also need Runtime Request Permission allow storage permission from app setting manually or you may use any package such as permission_handler.

Basic setup

The complete example is available here.

Required parameter for FileManager are controller and builder

  • controller The controller updates value and notifies its listeners, and FileManager updates itself appropriately whenever the user modifies the path or changes the sort-type with an associated FileManagerController.
final FileManagerController controller = FileManagerController();
  • builder This function allows you to create custom widgets and retrieve a list of entities List<FileSystemEntity>.

Sample code

FileManager(
    controller: controller,
    builder: (context, snapshot) {
    final List<FileSystemEntity> entities = snapshot;
      return ListView.builder(
        itemCount: entities.length,
        itemBuilder: (context, index) {
          return Card(
            child: ListTile(
              leading: FileManager.isFile(entities[index])
                  ? Icon(Icons.feed_outlined)
                  : Icon(Icons.folder),
              title: Text(FileManager.basename(entities[index])),
              onTap: () {
                if (FileManager.isDirectory(entities[index])) {
                    controller.openDirectory(entities[index]);   // open directory
                  } else {
                      // Perform file-related tasks.
                  }
              },
            ),
          );
        },
      );
  },
),

FileManager

Properties Description
loadingScreen For the loading screen, create a custom widget. A simple Centered CircularProgressIndicator is provided by default.
emptyFolder For an empty screen, create a custom widget.
controller For an empty screen, create a custom widget.
hideHiddenEntity Hide the files and folders that are hidden.
builder This function allows you to create custom widgets and retrieve a list of entities List<FileSystemEntity>.

FileManagerContoller

Properties Description
getSortedBy The sorting type that is currently in use is returned.
setSortedBy is used to set the sorting type. SortBy{ name, type, date, size }.
getCurrentDirectory Get current Directory
getCurrentPath Get current path, similar to [getCurrentDirectory].
setCurrentPath Set current directory path by providing String of path, similar to [openDirectory]. List<FileSystemEntity>.
isRootDirectory return true if current directory is the root. false, if the current directory not on root of the stogare.
goToParentDirectory Jumps to the parent directory of currently opened directory if the parent is accessible.
openDirectory Open directory by providing Directory.
titleNotifier ValueNotifier of the current directory's basename

Others

Properties Description
isFile check weather FileSystemEntity is File.
isDirectory check weather FileSystemEntity is Directory.
basename Get the basename of Directory or File. Provide File, Directory or FileSystemEntity and returns the name as a String. If you want to hide the extension of a file, you may use optional parameter showFileExtension. ie controller.dirName(dir, true)
formatBytes Convert bytes to human readable size.[getCurrentDirectory].
setCurrentPath Set current directory path by providing String of path, similar to [openDirectory]. List<FileSystemEntity>.
getStorageList Get list of available storage in the device, returns an empty list if there is no storage List<Directory>
createFolder Creates the directory if it doesn't exist. Requires currentPath and Name of the Directory.

Example Example Example Example

Show some ❤️ and the repo

GitHub Repo stars GitHub forks GitHub followers

Project Created & Maintained By

Contributions

Contributions are welcomed!

If you feel that a hook is missing, feel free to open a pull-request.

For a custom-hook to be merged, you will need to do the following:

  • Describe the use-case.

  • Open an issue explaining why we need this hook, how to use it, ... This is important as a hook will not get merged if the hook doens't appeal to a large number of people.

  • If your hook is rejected, don't worry! A rejection doesn't mean that it won't be merged later in the future if more people shows an interest in it. In the mean-time, feel free to publish your hook as a package on https://pub.dev.

  • A hook will not be merged unles fully tested, to avoid breaking it inadvertendly in the future.

Comments
  • Adattamenta funzione get storage list (crea cartella home)   home as default folder

    Adattamenta funzione get storage list (crea cartella home) home as default folder

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    YES | NO

    Description

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] ✅ Build configuration change
    • [ ] 📝 Documentation
    • [ ] 🗑️ Chore
    opened by Ali29 1
  • Reads controller's path for initial dir

    Reads controller's path for initial dir

    Status

    READY

    Breaking Changes

    NO

    Description

    Reads dir from controller to let developer specify initial path before displaying (#16) so that we can use controller.openDirectory(Directory(rootfolder)); in the widget's initState() to specify initial dir before build()

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] ✅ Build configuration change
    • [ ] 📝 Documentation
    • [ ] 🗑️ Chore
    opened by johnny77221 0
  • [Question] How to open other folder on app launch?

    [Question] How to open other folder on app launch?

    Hello, I have been working on this plugin but couldn't open any custom folder on app initialisation (like desktop, documents etc), i tried doing this via initState but didn't worked out.

    opened by Roxaine123 0
  • Update README.md

    Update README.md

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    YES | NO

    Description

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] ✅ Build configuration change
    • [x] 📝 Documentation
    • [ ] 🗑️ Chore
    opened by scss04 0
  • Updated ReadMe

    Updated ReadMe

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    YES | NO

    Description

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] ✅ Build configuration change
    • [x] 📝 Documentation
    • [ ] 🗑️ Chore
    opened by 4-alok 0
  • added formatBytes, readMe created, example ready, custom widget for empty folder

    added formatBytes, readMe created, example ready, custom widget for empty folder

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    YES | NO

    Description

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] 🧹 Code refactor
    • [x] ✅ Build configuration change
    • [x] 📝 Documentation
    • [x] 🗑️ Chore
    opened by 4-alok 0
  • Api Documentation

    Api Documentation

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    YES | NO

    Description

    Type of Change

    • [ ] ✨ New feature (non-breaking change which adds functionality)
    • [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [ ] 🧹 Code refactor
    • [ ] ✅ Build configuration change
    • [x] 📝 Documentation
    • [ ] 🗑️ Chore
    opened by Arpit-Sahu 0
  • File-manager sorting competed and Linux support added

    File-manager sorting competed and Linux support added

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    YES | NO

    Description

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [ ] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [x] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] 🧹 Code refactor
    • [ ] ✅ Build configuration change
    • [ ] 📝 Documentation
    • [ ] 🗑️ Chore
    opened by 4-alok 0
  • controller added for sort and back button.

    controller added for sort and back button.

    Status

    READY/IN DEVELOPMENT/HOLD

    Breaking Changes

    YES | NO

    Description

    Type of Change

    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [x] 🛠️ Bug fix (non-breaking change which fixes an issue)
    • [ ] ❌ Breaking change (fix or feature that would cause existing functionality to change)
    • [x] 🧹 Code refactor
    • [ ] ✅ Build configuration change
    • [ ] 📝 Documentation
    • [ ] 🗑️ Chore
    opened by Arpit-Sahu 0
  • ValueListenableBuilder<String> widget cannot be marked as needing to build.

    ValueListenableBuilder widget cannot be marked as needing to build.

    When I try to run the example code given, I get the below error. I'm not familiar with ValueNotifier and ValueListenableBuilder so I can't figure out, what seems to be the issue here.

    The following assertion was thrown while dispatching notifications for ValueNotifier: setState() or markNeedsBuild() called during build.

    This ValueListenableBuilder widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its ancestors is currently building. This exception is allowed because the framework builds parent widgets before children, which means a dirty descendant will always be built. Otherwise, the framework might not visit this widget during this build phase.

    I have found same issue in :https://stackoverflow.com/questions/71191775/valuelistenablebuilderstring-widget-cannot-be-marked-as-needing-to-build-sets

    opened by dasaki-gr 1
  • Some Directories return empty file list

    Some Directories return empty file list

    Describe the bug Some directories like /storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses/ shows Empty directory, even though device file manager shows file list.

    To Reproduce Steps to reproduce the behavior:

    1. Run Example App
    2. Go to /storage/emulated/0/Android/media/com.whatsapp/WhatsApp/Media/.Statuses/
    3. You can see Empty Directory

    Expected behavior Should show file list

    flutter doctor -v

    [√] Flutter (Channel stable, 3.3.4, on Microsoft Windows [Version 10.0.22000.1042], locale en-IN)
        • Flutter version 3.3.4 on channel stable at C:\flutter\1.0.0
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision eb6d86ee27 (5 weeks ago), 2022-10-04 22:31:45 -0700
        • Engine revision c08d7d5efc
        • Dart version 2.18.2
        • DevTools version 2.15.0
    
    [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at D:\Android\SDK
        • Platform android-33, build-tools 31.0.0
        • ANDROID_SDK_ROOT = D:\Android\SDK
        • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.15)
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
        • Visual Studio Build Tools 2019 version 16.11.32510.428
        • Windows 10 SDK version 10.0.18362.0
    
    [√] Android Studio (version 2021.2)
        • Android Studio at C:\Program Files\Android\Android Studio
        • Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
    
    [√] VS Code (version 1.73.1)
        • VS Code at C:\Users\PramUkesh\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.52.0
    
    [√] Connected device (4 available)
        • M2012K11I (mobile) • 192.168.0.108:38199 • android-arm64  • Android 12 (API 32)
        • Windows (desktop)  • windows             • windows-x64    • Microsoft Windows [Version 10.0.22000.1042]
        • Chrome (web)       • chrome              • web-javascript • Google Chrome 106.0.5249.119
        • Edge (web)         • edge                • web-javascript • Microsoft Edge 107.0.1418.26
    
    [√] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    

    Additional context Device OS: Android 12

    opened by canewsin 0
  • ✨ Support custom error builder

    ✨ Support custom error builder

    Status

    READY

    Breaking Changes

    NO

    Description

    • Support custom error builder. #20
    • Fix some typos.
    • [x] ✨ New feature (non-breaking change which adds functionality)
    • [x] 🗑️ Chore
    opened by simonpham 0
  • Custom errorPage

    Custom errorPage

    Support passing error page instead of returning below default red screen.

    Container _errorPage(String error) {
        return Container(
          color: Colors.red,
          child: Center(
            child: Text("Error: $error"),
          ),
        );
      }
    
    opened by simonpham 0
  • Android 12 zip,txt,pdf all type of document not showing.

    Android 12 zip,txt,pdf all type of document not showing.

    in Android 11 and 12 it gives only images and video files and all other types of format files not showing in list please resolve this issue as soon as possible Thanks!.

    opened by arpitweetech 6
  • Is there a filesTree() equivalent in this package like before ?

    Is there a filesTree() equivalent in this package like before ?

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is.

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    opened by udithv 0
Releases(v1.0.0)
BankGit helps you manage your account and transactions more efficiently by breaking your account into branches for various purposes and then making transactions directly from them.

Bank Git Web Hosted Here : https://bank-management-45848.web.app/ Bank Git is an application built with Flutter and Firebase to help you manage your b

Yash Johri 27 Dec 26, 2022
About This is Personal Expenses Planner. You can add your expenses in to the app and manage your transaction. and you can see How much did you spend on which day. I developed this project using flutter.

expense_planner A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Darshit Rudani 5 Jul 6, 2022
Amazing Flutter package for playing audio with a lot of features to offer.

Flutter_exoplayer A Flutter plugin that let's you play multiple audio files simultaneously with an option to choose if to play in background or as a f

Daniel 48 Aug 7, 2022
App to learn how to code with a lot of great courses and ideas of projects to do, focused on productivity and fast learn. 💻

skoola A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this i

Batista Tony 3 Oct 29, 2021
This app is a minimal TodoList app that functions like a whiteboard. You can add new tasks, keep track of your tasks to make your day more productive, and then delete it after it is done.

My First Mobile App _ Minimal TodoList Flutter A new Flutter project. Getting Started This project is a starting point for a Flutter application. A fe

null 0 Nov 23, 2021
Windows95 UI components for Flutter apps. Bring back the nostalgic look and feel of old operating systems with this set of UI components ready to use.

Flutter95 Windows95 UI components for Flutter apps. UNDER CONSTRUCTION Screenshots Components Scaffold95 Scaffold as a Windows95 styled window. Provid

Miguel Beltran 141 Jan 2, 2023
An end-to-end Flutter app built to get details and trending recipes - made as a part of the book 'Flutter Apprentice' by raywenderlich.com

Fooderlich - Flutter Apprentice An end-to-end Flutter app built to get details and trending recipes - made as a part of the book 'Flutter Apprentice'

Suvaditya Mukherjee 1 Dec 4, 2021
An app built using flutter for ResearchNeeda medical Startup as part of Hackathon 2020 conducted by Deshpande startups

research_final A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

dev_allauddin 3 Feb 3, 2022
Plant-Disease-Detector - A Flutter app that detects a plant's disease given a photo of an affected part of the plant

Plant Disease Detector A Flutter app that detects a plant's disease given a phot

suis458 5 Dec 14, 2022
I was challenged to create an app with only the Nubank life insurance part and fix some UI issues.

Seguros I was challenged to create an App with only the Nubank life insurance part and fix some UI issues. Flutter This is a Flutter App, designed bas

Caio Moura 14 Dec 14, 2022
WeCare is a logistics management platform that can manage everything like delivering goods in time and in a preferable cost.

wecare_logistics A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Shaurya kajiwala 5 Nov 10, 2022
A performant, expressjs like server framework with a few gadgets that make life even easier.

Alfred A performant, expressjs like server framework thats easy to use and has all the bits in one place. Quickstart: import 'package:alfred/alfred.da

Ryan Knell 449 Jan 2, 2023
A chat-like app that allows students to exchange chargers given port type and the room it is currently located in.

charger_connect A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Lani 2 Dec 22, 2021
Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainder to the task, set color to separate tasks and it allows to add URL with URL's informations.

Utility Manager Flutter Application! Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainde

Kathirvel Chandrasekaran 6 Jan 6, 2022
This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return as Image and share them directly as well in the form of an image.

share_files_and_screenshot_widgets This pub lets you share any kind of files (csv, mp4, png etc), take screenshot of the widgets you want and return a

Jay Mehta 22 Dec 28, 2022
Sorting Visualizer using Flutter followed MVVM Pattern and used Stacked Services. Hope you like it 😋

Sortlizer An App to visualize various sorting algorithms...Developed using Flutter, followed MVVM pattern, and used stacked services. Play Store Link

Roshan Kumar 17 Dec 28, 2022
This app developed for making fun with sms. You can send huge sms to other's number by one click. It is behaving like a bomb

SMS Bomber This app developed for making fun with sms. You can send huge sms to other's number by one click. It is behaving like a bomb Getting Starte

Md Abir Ahsan Tahmim 1 Dec 21, 2021
Flutter Catalog is a very handy catalog of beautifully designed widgets to help ease your flutter journey.

davidcobbina.com Flutter Catalog Flutter Catalog is a very handy catalog of beautifully designed widgets to help ease your flutter journey. It is insp

David-Legend 299 Nov 20, 2022
An animated flutter UI for E-commerce product variant selection / add to cart developed by nonybrighto and designed by Akram Khalid.

Crate & Barrel - Dark Mobile App Concept Animated An animated flutter UI for E-commerce product variant selection / add to cart developed by nonybrigh

Nony Bright O 47 Mar 28, 2022