filex 0.2.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 77

Filex #

pub package

Configurable file explorer widget for Flutter


Usage #


   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';

     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 {
   Widget build(BuildContext context) {
      final controller = FilexController(path: dir.path);
      return Scaffold(
         appBar: AppBar(
           title: const Text("Files"),
           actions: <Widget>[
               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 : 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:

    controller: controller,
    actions: <PredefinedAction>[PredefinedAction.delete],
    extraActions: <FilexSlidableAction>[
        name: "My action",
        iconData: Icons.file_upload,
        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

Changelog #

0.2.2 #

Use a rxdart replaySubject stream for changefeed

0.2.1 #

Make the changefeed stream broadcast

0.2.0 #

  • Add a fileTrailingBuilder parameter
  • Add a showOnlyDirectories parameter

0.1.0 #

Initial release


example #

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 is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  filex: ^0.2.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:filex/filex.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 21, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (open_file, rxdart).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
cupertino_icons ^0.1.2 0.1.3
filesize ^1.0.2 1.0.4
flutter 0.0.0
flutter_slidable ^0.5.3 0.5.4
open_file ^2.0.3 2.1.1 3.0.1
path ^1.6.2 1.6.4
pedantic ^1.6.0 1.9.0
rxdart ^0.22.2 0.22.6 0.23.1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies