flutter_file_utils 0.1.1+5

  • Readme
  • Changelog
  • Installing
  • 76

flutter_file_utils #

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_provider: ^1.6.7
  flutter_file_utils: ^0.1.1

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_utils/flutter_file_utils.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
  • System Tools
    • Copy
    • Rename

Contributors #

Contact me #

  • me.dev6789@gmail.com

[0.1.1+5] #

  • update plugins

[0.1.1+4] #

  • update plugins

[0.1.1+1] #

  • update plugins

[0.1.1+1] #

  • update readme

[0.1.1] #

  • update readme

[0.1.0] #

  • New name: flutter_file_utils
  • New structure
  • Optimization
  • Concentrating on streams
  • And more...

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_file_utils: ^0.1.1+5

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

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

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform android

Because of import path [package:flutter_file_utils/flutter_file_utils.dart, package:flutter_file_utils/src/filter.dart, package:flutter_file_utils/src/file_system_utils.dart, package:path_provider/path_provider.dart, package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform ios

Because of import path [package:flutter_file_utils/flutter_file_utils.dart, package:flutter_file_utils/src/filter.dart, package:flutter_file_utils/src/file_system_utils.dart, package:path_provider/path_provider.dart, package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform macos

Because of import path [package:flutter_file_utils/flutter_file_utils.dart, package:flutter_file_utils/src/filter.dart, package:flutter_file_utils/src/file_system_utils.dart, package:path_provider/path_provider.dart, package:path_provider_linux/path_provider_linux.dart] that declares support for platforms: linux

Package does not support Flutter platform web

Because of import path [package:flutter_file_utils/flutter_file_utils.dart, package:flutter_file_utils/src/filter.dart, package:flutter_file_utils/src/file_system_utils.dart, package:path_provider/path_provider.dart] that declares support for platforms: android, ios, linux, macos

Package does not support Flutter platform windows

Because of import path [package:flutter_file_utils/flutter_file_utils.dart, package:flutter_file_utils/src/filter.dart, package:flutter_file_utils/src/file_system_utils.dart, package:path_provider/path_provider.dart] that declares support for platforms: android, ios, linux, macos

Package not compatible with SDK dart

because of import path [flutter_file_utils] that is in a package requiring null.

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.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and flutter_file_utils.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
flutter 0.0.0
package_info ^0.4.1 0.4.1
path ^1.7.0 1.7.0
path_provider ^1.6.11 1.6.11
Transitive dependencies
collection 1.14.12 1.14.13
file 5.2.1
intl 0.16.1
meta 1.1.8
path_provider_linux 0.0.1+2
path_provider_macos 0.0.4+3
path_provider_platform_interface 1.0.2
platform 2.2.1
plugin_platform_interface 1.0.2
process 3.0.13
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
xdg_directories 0.1.0
Dev dependencies
pedantic ^1.9.0