flutter_file_manager 0.2.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

flutter_file_manager #

Helper tools for managing files on Android.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

Screenshots #

Usage #

To use this package, add these
dependency in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter
  path: 1.6.2
  path_provider: 0.5.0+1
  flutter_file_manager: ^0.2.0

And, add read / write permissions in your android/app/src/main/AndroidManifest.xml

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

Don't forget to grant Storage permissions to your app, manually or by this plugin simple_permissions

// dart files
import 'dart:async';

// framework
import 'package:flutter/material.dart';

// packages
import 'package:path_provider/path_provider.dart';
import 'package:flutter_file_manager/flutter_file_manager.dart';
import 'package:simple_permissions/simple_permissions.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    SimplePermissions.requestPermission(Permission.ReadExternalStorage);
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("Flutter File Manager Example"),
        ),
        body: FutureBuilder(
            future: _files(),
            builder: (BuildContext context, AsyncSnapshot snapshot) {
              if (snapshot.connectionState == ConnectionState.done) {
                return ListView.builder(
                  itemCount: snapshot.data?.length ?? 0,
                  itemBuilder: (context, index) {
                    return ListTile(
                      title: Text(snapshot.data[index].path.split('/').last),
                    );
                  },
                );
              } else if (snapshot.connectionState == ConnectionState.waiting) {
                return Center(child: Text("Loading"));
              }
            }),
      ),
    );
  }

  _files() async {
    var root = await getExternalStorageDirectory();
    var files = await FileManager(root: root).walk().toList();
    return files;
  }
}

Examples #

Features #

  • file details
  • search files or directories: supports regular expressions
  • recent created files: you can exclude a list of directories from the tree
  • directories only tree: you can exclude a list of directories from the tree
  • files only tree: you can exclude a list of directories from the tree
  • files list from specific point
  • delete files
  • delete directory
  • temp file
  • Sorting
    • Type
    • Size
    • date
    • Alpha
  • filtering
    • extensions
    • files only
    • directories only

Contributors #

Contact me #

  • me.dev6789@gmail.com

[0.2.0]

  • Restructuring
  • Improvements
  • Filters
  • Streams
  • ...

[0.1.1]

  • fix bugs

[0.1.0]

  • major changes
  • now most functions return Directory or File types
  • optimization
  • fixing bugs
  • ...

[0.0.6]

  • optimization
  • fixing bugs

[0.0.5]

  • fixing bugs

[0.0.4]

  • re-structuring
  • fixing some bugs

[0.0.3]

  • correcting files.

[0.0.2]

  • second release.

[0.0.1]

  • initial release.

example/README.md

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:


dependencies:
  flutter_file_manager: ^0.2.0

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:flutter_file_manager/flutter_file_manager.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
87
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
82
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.4

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/flutter_file_manager.dart.

Run flutter format to format lib/flutter_file_manager.dart.

Maintenance suggestions

The package description is too short. (-18 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
path >=1.5.1 <3.0.0 1.6.4
path_provider >=0.4.0 <3.0.0 1.3.1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test