flutter_file_utils

Last updated:

0 purchases

flutter_file_utils Image
flutter_file_utils Images
Add to Cart

Description:

flutter file utils

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
copied to clipboard
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"/>
copied to clipboard
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;
}
}

copied to clipboard
Examples #

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 #

Mohamed Naga

Donate #

PayPal
[email protected]

Contact me #

[email protected]

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.