Configurable file explorer widget for Flutter

Related tags

Templates filex
Overview

Filex

pub package

Configurable file explorer widget for Flutter

Screenshot

Usage

Simple:

import 'package:filex/filex.dart';
import 'package:path_provider/path_provider.dart';

dir = await getApplicationDocumentsDirectory();
final controller = FilexController(path: dir.path);
Filex(controller: controller);

With leading and trailing builders:

import 'package:filex/filex.dart';

Filex(
  compact: true,
  directory: Directory("some_dir_path"),
  directoryTrailingBuilder: (context, item) {
    return GestureDetector(
      child: Padding(
        padding: const EdgeInsets.fromLTRB(0, 0, 3.0, 0),
        child: Icon(Icons.file_download,
          color: Colors.grey, size: 20.0)),
        onTap: () => doSomething(item));
})

Trailing and leading options are: fileTrailingBuilder, directoryLeadingBuilder and directoryTrailingBuilder

Controller

Include dialogs to add and delete directories:

class FileExplorer extends StatelessWidget {
@override
Widget build(BuildContext context) {
   final controller = FilexController(path: dir.path);
   return Scaffold(
      appBar: AppBar(
        title: const Text("Files"),
        actions: <Widget>[
          IconButton(
            icon: Icon(Icons.add),
            onPressed: () => controller.addDirectory(context),
          )
        ],
      ),
      body: Filex(
        controller: controller,
        actions: <PredefinedAction>[PredefinedAction.delete],
      ),
    );
  }
}

Available controller actions:

controller.delete(DirectoryItem item) : delete a file or directory

controller.createDirectory(String name) : create a directory

controller.ls() : list the current directory

controller.dispose() : dispose the bloc when finished using

Custom actions

It is possible to add custom actions in the slidable menu:

Filex(
    controller: controller,
    actions: <PredefinedAction>[PredefinedAction.delete],
    extraActions: <FilexSlidableAction>[
    FilexSlidableAction(
        name: "My action",
        iconData: Icons.file_upload,
        color: Colors.blue,
        onTap: customAction,
    )
    ],
)

void customAction(BuildContext context, DirectoryItem item) {
    // action here
}

Changefeed

A stream with directory listing items is available to implement on change callbacks:

StreamSubscription<List<DirectoryItem>> _sub;
_sub = controller.changefeed.listen((items) {
  // do something
});
You might also like...

Opensource Wallet & Explorer by joinseeds.com

seeds_light_wallet Opensource Wallet & Explorer by joinseeds.com A payment platform and financial ecosystem to empower humanity and heal our planet Ge

Dec 30, 2022

DeFi Scan - Mobile BlockChain Explorer app for cryptocurrency accounts.

DeFi Scan - Mobile BlockChain Explorer app for cryptocurrency accounts.

DeFi Scan This is the official repository for DeFi Scan - a mobile blockchain explorer built with Dart/Flutter for searching, curating and storing det

Dec 20, 2022

Widget to count the amount of nested widget tree, useful in the dynamic construction of the interface when it is important to know the depth of widget.

Widget to count the amount of nested widget tree, useful in the dynamic construction of the interface when it is important to know the depth of widget.

widget_tree_depth_counter Widget Tree Depth Counter WidgetTreeDepthCounter is a simple widget to count the amount of nested widget tree, useful in the

Aug 1, 2022

Flutter ui boilerplate is easiest way to create new flutter project with clean code and well organized file folder.

Flutter ui boilerplate is easiest way to create new flutter project with clean code and well organized file folder.

Flutter UI Boilerplate "Sharing for fun" Flutter ui boilerplate is easiest way to create new flutter project with clean code and well organized file f

Dec 1, 2022

Flutter file manager - Flutter package for managing files on Android

Flutter file manager - Flutter package for managing files on Android

flutter_file_utils Helper tools for managing files on Android. Getting Started For help getting started with Flutter, view our online documentation. F

Nov 11, 2022

Sane File Logging for Flutter/Dart.

sane_flog A sane flutter api logging library. How to use // initialize logger ... final logger = Logger('url_of_api_to_log_to'); ... // enum Level

Nov 20, 2021

Open-source, cross-platform, hassle-free file sharing with AES-256 encryption made with Flutter & Dart.

Open-source, cross-platform, hassle-free file sharing with AES-256 encryption made with Flutter & Dart.

Odin ⚡ Open source easy file sharing for everyone. ⚡ Cross-platform hassle-free file sharing with AES-256 encryption made with Flutter & Dart. Getting

Dec 22, 2022

A cross-platform Flutter home workout app that respects your privacy. THIS IS A GITLAB MIRROR, file issues and contribute there.

A cross-platform Flutter home workout app that respects your privacy. THIS IS A GITLAB MIRROR, file issues and contribute there.

Feeel Feeel is an open-source workout app for doing simple at-home exercises. This is a rewrite of the original app in Flutter, to make development ea

Dec 26, 2022
Comments
  • Need Upgrade for flutter 2.0.2 null safety

    Need Upgrade for flutter 2.0.2 null safety

    need null safety version for this plugin. I upgrade my project to flutter 2.0.2. After that when goes to upgrade plugins, ex. for path_provider through

    filex 0.3.0 depends on path_provider ^1.6.24 and no versions of filex match >0.3.0 <0.4.0, filex ^0.3.0 requires path_provider ^1.6.24. So, because myapps depends on both path_provider 2.0.1 and filex ^0.3.0, version solving failed. pub get failed (1; So, because myapps depends on both path_provider 2.0.1 and filex ^0.3.0, version solving failed.) exit code 1

    opened by Basher7 2
  • Feature Request : Add support for top navigation irrespective of the current folder path

    Feature Request : Add support for top navigation irrespective of the current folder path

    Currently, top navigation is visible for non root directories. But in our current applications, once a user selects a folder, the root directory is changed to this directory (to help him navigating). Now, the user is unable to go back to the parent folder, in case if he wants to change it.

    If we don't change the root folder, then every time, user has to navigate himself.

    Can I work on this and raise a pr to make this top navigation optional?

    opened by pvsvamsi 0
Releases(0.3.0)
Owner
"All that is gold does not glitter, not all those who wander are lost". Tolkien
null
Flutter-FFNavigationBar - Configurable navigation bar for Flutter

ff_navigation_bar A highly configurable navigation bar with emphasis for the selected item. Add dependency dependencies: ff_navigation_bar: ^0.1.5

55 Builds 211 Sep 22, 2022
Configurable navigation bar for Flutter

ff_navigation_bar A highly configurable navigation bar with emphasis for the selected item. Add dependency dependencies: ff_navigation_bar: ^0.1.5

55 Builds 211 Sep 22, 2022
Esizer - A Flutter package provide responsive, dynamic, configurable size for each device screen size

ESizer A Flutter package provide responsive, dynamic, configurable size for each

Extreme Vietnam Public 1 Feb 15, 2022
Access app version and git informations from auto-generated and configurable widgets

This is a proof of concept and WIP Feedback and ideas welcome !! Access your pubspec and git commit informations like versions and commit status from

Robert Felker 15 Jul 7, 2021
An easy configurable and secure open-source personal password manager.

An easy configurable and secure open-source personal password manager. Anyone can you this project and generate his own personal mobile app. All the passwords will be saved into your own Firebase Firestone database with encryption.

Shudipto Trafder 18 Dec 28, 2022
Flutter file based routing - File based routing and nested layouts for Flutter

Flutter File Based Routing I was inspired by the routing in remix.run with neste

Rody Davis 10 Sep 29, 2022
A simple flutter app that downloads a file from the internet, shows a custom-made download progress dialog and saves the file to device's internal storage

http_downloader A simple flutter app that downloads a file from the internet using the http plugin. It has a custom-designed progress dialog which dis

Akora Ing. Debrah Kwesi Buabeng 4 Apr 6, 2021
This project is a rebuild of the existing movie colony https://github.com/debbsefe/Movie-Colony. Here's also a link to the figma file https://www.figma.com/file/XpLFNEsROiN1z6lwnNHMrU/Movie-app?node-id=2956%3A10161

Tvfiy Generated by the Very Good CLI ?? A Very Good Project created by Very Good CLI. Getting Started ?? This project contains 3 flavors: development

Eferha Mamus 3 Nov 12, 2022
Aves is a gallery and metadata explorer app, built for Android with Flutter.

Aves Aves is a gallery and metadata explorer app. It is built for Android, with Flutter. Features Aves can handle all sorts of images and videos, incl

Thibault Deckers 729 Jan 3, 2023
A mobile version of the COCO Explorer written in Dart with Flutter Framework.

COCO Explorer Mobile A mobile version of the COCO Explorer written in Dart with Flutter Framework. Cloning the repo From GitHub: Download or clone the

Mohammad Sobhy 2 May 13, 2022