├── .flutter-plugins ├── .gitignore ├── .vscode └── launch.json ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── app │ └── src │ │ └── main │ │ └── java │ │ └── io │ │ └── flutter │ │ └── plugins │ │ └── GeneratedPluginRegistrant.java └── local.properties ├── example ├── .flutter-plugins-dependencies ├── .gitignore ├── .metadata ├── LICENSE ├── README.md ├── android │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── app │ │ ├── .classpath │ │ ├── .project │ │ ├── .settings │ │ │ └── org.eclipse.buildship.core.prefs │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── settings_aar.gradle ├── ios │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── flutter_export_environment.sh │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ └── contents.xcworkspacedata │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ ├── file_search_example.dart │ ├── files_list_example.dart │ ├── files_tree_example.dart │ ├── filtering_example.dart │ ├── main.dart │ ├── permissions.txt │ ├── recent_files_example.dart │ └── sorting_example.dart ├── pubspec.lock └── pubspec.yaml ├── flutter_file_utils.iml ├── lib ├── flutter_file_utils.dart ├── src │ ├── exceptions.dart │ ├── file_manager.dart │ ├── file_system_utils.dart │ ├── filter.dart │ ├── io_extensions.dart │ ├── sorting.dart │ ├── storage_utils.dart │ └── time_tools.dart └── utils.dart ├── pubspec.lock ├── pubspec.yaml └── screenshots ├── details.jpg ├── filtering_example.png └── permission.jpg /.flutter-plugins: -------------------------------------------------------------------------------- 1 | path_provider=E:\\programs\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\path_provider-0.5.0+1\\ 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | ios/.generated/ 9 | ios/Flutter/Generated.xcconfig 10 | ios/Runner/GeneratedPluginRegistrant.* 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Dart", 9 | "type": "dart", 10 | "request": "launch", 11 | "program": "bin/main.dart" 12 | }, 13 | { 14 | "name": "Flutter", 15 | "request": "launch", 16 | "program": "example/lib/main.dart", 17 | "type": "dart" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [0.2.0] 2 | * New name: flutter_file_utils 3 | * New structure 4 | * Optimization 5 | * Concentrating on streams 6 | * And more... 7 | 8 | # [0.2.0] 9 | 10 | * Restructuring 11 | * Improvements 12 | * Filters 13 | * Streams 14 | * ... 15 | 16 | # [0.1.1] 17 | 18 | * fix bugs 19 | 20 | # [0.1.0] 21 | 22 | * major changes 23 | * now most functions return Directory or File types 24 | * optimization 25 | * fixing bugs 26 | * ... 27 | 28 | ## [0.0.6] 29 | 30 | * optimization 31 | * fixing bugs 32 | 33 | ## [0.0.5] 34 | 35 | * fixing bugs 36 | 37 | ## [0.0.4] 38 | 39 | * re-structuring 40 | * fixing some bugs 41 | 42 | ## [0.0.3] 43 | 44 | * correcting files. 45 | 46 | ## [0.0.2] 47 | 48 | * second release. 49 | 50 | ## [0.0.1] 51 | 52 | * initial release. 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Mohamed Elsayed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # flutter_file_utils 2 | 3 | Helper tools for managing files on Android. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view our online [documentation](https://flutter.io/). 8 | 9 | For help on editing package code, view the [documentation](https://flutter.io/developing-packages/). 10 | 11 | ## Screenshots 12 | 13 |

14 | 15 | 16 | 17 |

18 | 19 | ## Usage 20 | 21 | To use this package, add these 22 | dependency in your `pubspec.yaml` file. 23 | 24 | ```yaml 25 | dependencies: 26 | flutter: 27 | sdk: flutter 28 | path: 1.6.2 29 | path_provider: 0.5.0+1 30 | flutter_file_utils: ^0.2.0 31 | ``` 32 | 33 | And, add read / write permissions in your 34 | `android/app/src/main/AndroidManifest.xml` 35 | 36 | ````xml 37 | 38 | 39 | ```` 40 | 41 | Don't forget to grant `Storage` permissions to your app, manually or by this plugin [simple_permissions](https://pub.dartlang.org/packages/simple_permissions) 42 | 43 | ```dart 44 | // dart files 45 | import 'dart:async'; 46 | 47 | // framework 48 | import 'package:flutter/material.dart'; 49 | 50 | // packages 51 | import 'package:path_provider/path_provider.dart'; 52 | import 'package:flutter_file_utils/flutter_file_utils.dart'; 53 | import 'package:simple_permissions/simple_permissions.dart'; 54 | 55 | void main() => runApp(new MyApp()); 56 | 57 | class MyApp extends StatefulWidget { 58 | _MyAppState createState() => _MyAppState(); 59 | } 60 | 61 | class _MyAppState extends State { 62 | @override 63 | Widget build(BuildContext context) { 64 | SimplePermissions.requestPermission(Permission.ReadExternalStorage); 65 | return MaterialApp( 66 | home: Scaffold( 67 | appBar: AppBar( 68 | title: Text("Flutter File Manager Example"), 69 | ), 70 | body: FutureBuilder( 71 | future: _files(), 72 | builder: (BuildContext context, AsyncSnapshot snapshot) { 73 | if (snapshot.connectionState == ConnectionState.done) { 74 | return ListView.builder( 75 | itemCount: snapshot.data?.length ?? 0, 76 | itemBuilder: (context, index) { 77 | return ListTile( 78 | title: Text(snapshot.data[index].path.split('/').last), 79 | ); 80 | }, 81 | ); 82 | } else if (snapshot.connectionState == ConnectionState.waiting) { 83 | return Center(child: Text("Loading")); 84 | } 85 | }), 86 | ), 87 | ); 88 | } 89 | 90 | _files() async { 91 | var root = await getExternalStorageDirectory(); 92 | var files = await FileManager(root: root).walk().toList(); 93 | return files; 94 | } 95 | } 96 | 97 | ``` 98 | 99 | ### Examples 100 | 101 | * [examples](https://github.com/nagakm/flutter_file_utils/tree/master/example/lib) 102 | 103 | ### Features 104 | 105 | * File Details 106 | * Search files or directories: supports regular expressions 107 | * Recent created files: you can exclude a list of directories from the tree 108 | * Directories only tree: you can exclude a list of directories from the tree 109 | * Files only tree: you can exclude a list of directories from the tree 110 | * Files list from specific point 111 | * Delete files 112 | * Delete directory 113 | * Temp file 114 | * Sorting 115 | * Type 116 | * Size 117 | * Date 118 | * Alpha 119 | * [Filtering](https://github.com/nagakm/flutter_file_utils/blob/master/example/lib/filtering_example.dart) 120 | * Extensions 121 | * Files only 122 | * Directories only 123 | * System Tools 124 | * Copy 125 | * Rename 126 | 127 | ### Contributors 128 | 129 | * [Mohamed Naga](https://github.com/nagakm) 130 | 131 | ## Donate 132 | 133 | * [PayPal](https://www.paypal.me/eagle6789) 134 | * me49544@gmail.com 135 | 136 | ### Contact me 137 | 138 | * me.dev6789@gmail.com 139 | -------------------------------------------------------------------------------- /android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java: -------------------------------------------------------------------------------- 1 | package io.flutter.plugins; 2 | 3 | import io.flutter.plugin.common.PluginRegistry; 4 | import io.flutter.plugins.pathprovider.PathProviderPlugin; 5 | 6 | /** 7 | * Generated file. Do not edit. 8 | */ 9 | public final class GeneratedPluginRegistrant { 10 | public static void registerWith(PluginRegistry registry) { 11 | if (alreadyRegisteredWith(registry)) { 12 | return; 13 | } 14 | PathProviderPlugin.registerWith(registry.registrarFor("io.flutter.plugins.pathprovider.PathProviderPlugin")); 15 | } 16 | 17 | private static boolean alreadyRegisteredWith(PluginRegistry registry) { 18 | final String key = GeneratedPluginRegistrant.class.getCanonicalName(); 19 | if (registry.hasPlugin(key)) { 20 | return true; 21 | } 22 | registry.registrarFor(key); 23 | return false; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/local.properties: -------------------------------------------------------------------------------- 1 | sdk.dir=E:\\android_development\\Sdk 2 | flutter.sdk=E:\\programs\\flutter 3 | flutter.versionName=0.1.0 -------------------------------------------------------------------------------- /example/.flutter-plugins-dependencies: -------------------------------------------------------------------------------- 1 | {"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":[]},{"name":"simple_permissions","dependencies":[]}]} -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | 65 | # Exceptions to above rules. 66 | !**/ios/**/default.mode1v3 67 | !**/ios/**/default.mode2v3 68 | !**/ios/**/default.pbxuser 69 | !**/ios/**/default.perspectivev3 70 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 71 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Mohamed Elsayed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.io/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.io/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.io/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | -------------------------------------------------------------------------------- /example/android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir= 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /example/android/app/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /example/android/app/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | app 4 | Project app created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /example/android/app/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | connection.project.dir=.. 2 | eclipse.preferences.version=1 3 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "com.example.example" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'androidx.test.ext:junit:1.1.1' 60 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 61 | } 62 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.example; 2 | 3 | import android.os.Bundle; 4 | import io.flutter.app.FlutterActivity; 5 | import io.flutter.plugins.GeneratedPluginRegistrant; 6 | 7 | public class MainActivity extends FlutterActivity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | GeneratedPluginRegistrant.registerWith(this); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /example/android/settings_aar.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/flutter_export_environment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This is a generated file; do not edit or check into version control. 3 | export "FLUTTER_ROOT=D:\tools\flutter\flutter" 4 | export "FLUTTER_APPLICATION_PATH=D:\git\flutter_file_utils\example" 5 | export "FLUTTER_TARGET=lib\main.dart" 6 | export "FLUTTER_BUILD_DIR=build" 7 | export "SYMROOT=${SOURCE_ROOT}/../build\ios" 8 | export "FLUTTER_FRAMEWORK_DIR=D:\tools\flutter\flutter\bin\cache\artifacts\engine\ios" 9 | export "FLUTTER_BUILD_NAME=1.0.0" 10 | export "FLUTTER_BUILD_NUMBER=1.0.0" 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 13 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 14 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 15 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 16 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 43 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 44 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 45 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 48 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 49 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 50 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 52 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 53 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 54 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 55 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 64 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 9740EEB11CF90186004384FC /* Flutter */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 3B80C3931E831B6300D905FE /* App.framework */, 75 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 76 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 77 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 78 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 79 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 80 | ); 81 | name = Flutter; 82 | sourceTree = ""; 83 | }; 84 | 97C146E51CF9000F007C117D = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9740EEB11CF90186004384FC /* Flutter */, 88 | 97C146F01CF9000F007C117D /* Runner */, 89 | 97C146EF1CF9000F007C117D /* Products */, 90 | CF3B75C9A7D2FA2A4C99F110 /* Frameworks */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 97C146EF1CF9000F007C117D /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 97C146EE1CF9000F007C117D /* Runner.app */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 97C146F01CF9000F007C117D /* Runner */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 106 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 107 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 108 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 109 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 110 | 97C147021CF9000F007C117D /* Info.plist */, 111 | 97C146F11CF9000F007C117D /* Supporting Files */, 112 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 113 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 114 | ); 115 | path = Runner; 116 | sourceTree = ""; 117 | }; 118 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146F21CF9000F007C117D /* main.m */, 122 | ); 123 | name = "Supporting Files"; 124 | sourceTree = ""; 125 | }; 126 | /* End PBXGroup section */ 127 | 128 | /* Begin PBXNativeTarget section */ 129 | 97C146ED1CF9000F007C117D /* Runner */ = { 130 | isa = PBXNativeTarget; 131 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 132 | buildPhases = ( 133 | 9740EEB61CF901F6004384FC /* Run Script */, 134 | 97C146EA1CF9000F007C117D /* Sources */, 135 | 97C146EB1CF9000F007C117D /* Frameworks */, 136 | 97C146EC1CF9000F007C117D /* Resources */, 137 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 138 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 139 | ); 140 | buildRules = ( 141 | ); 142 | dependencies = ( 143 | ); 144 | name = Runner; 145 | productName = Runner; 146 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 147 | productType = "com.apple.product-type.application"; 148 | }; 149 | /* End PBXNativeTarget section */ 150 | 151 | /* Begin PBXProject section */ 152 | 97C146E61CF9000F007C117D /* Project object */ = { 153 | isa = PBXProject; 154 | attributes = { 155 | LastUpgradeCheck = 0910; 156 | ORGANIZATIONNAME = "The Chromium Authors"; 157 | TargetAttributes = { 158 | 97C146ED1CF9000F007C117D = { 159 | CreatedOnToolsVersion = 7.3.1; 160 | }; 161 | }; 162 | }; 163 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 164 | compatibilityVersion = "Xcode 3.2"; 165 | developmentRegion = English; 166 | hasScannedForEncodings = 0; 167 | knownRegions = ( 168 | en, 169 | Base, 170 | ); 171 | mainGroup = 97C146E51CF9000F007C117D; 172 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 173 | projectDirPath = ""; 174 | projectRoot = ""; 175 | targets = ( 176 | 97C146ED1CF9000F007C117D /* Runner */, 177 | ); 178 | }; 179 | /* End PBXProject section */ 180 | 181 | /* Begin PBXResourcesBuildPhase section */ 182 | 97C146EC1CF9000F007C117D /* Resources */ = { 183 | isa = PBXResourcesBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 187 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 188 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 189 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 190 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | name = "Thin Binary"; 205 | outputPaths = ( 206 | ); 207 | runOnlyForDeploymentPostprocessing = 0; 208 | shellPath = /bin/sh; 209 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 210 | }; 211 | 9740EEB61CF901F6004384FC /* Run Script */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | ); 216 | inputPaths = ( 217 | ); 218 | name = "Run Script"; 219 | outputPaths = ( 220 | ); 221 | runOnlyForDeploymentPostprocessing = 0; 222 | shellPath = /bin/sh; 223 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 224 | }; 225 | /* End PBXShellScriptBuildPhase section */ 226 | 227 | /* Begin PBXSourcesBuildPhase section */ 228 | 97C146EA1CF9000F007C117D /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 233 | 97C146F31CF9000F007C117D /* main.m in Sources */, 234 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 235 | ); 236 | runOnlyForDeploymentPostprocessing = 0; 237 | }; 238 | /* End PBXSourcesBuildPhase section */ 239 | 240 | /* Begin PBXVariantGroup section */ 241 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 242 | isa = PBXVariantGroup; 243 | children = ( 244 | 97C146FB1CF9000F007C117D /* Base */, 245 | ); 246 | name = Main.storyboard; 247 | sourceTree = ""; 248 | }; 249 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 250 | isa = PBXVariantGroup; 251 | children = ( 252 | 97C147001CF9000F007C117D /* Base */, 253 | ); 254 | name = LaunchScreen.storyboard; 255 | sourceTree = ""; 256 | }; 257 | /* End PBXVariantGroup section */ 258 | 259 | /* Begin XCBuildConfiguration section */ 260 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 261 | isa = XCBuildConfiguration; 262 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 263 | buildSettings = { 264 | ALWAYS_SEARCH_USER_PATHS = NO; 265 | CLANG_ANALYZER_NONNULL = YES; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_COMMA = YES; 273 | CLANG_WARN_CONSTANT_CONVERSION = YES; 274 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 275 | CLANG_WARN_EMPTY_BODY = YES; 276 | CLANG_WARN_ENUM_CONVERSION = YES; 277 | CLANG_WARN_INFINITE_RECURSION = YES; 278 | CLANG_WARN_INT_CONVERSION = YES; 279 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 280 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 281 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 282 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 283 | CLANG_WARN_STRICT_PROTOTYPES = YES; 284 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 285 | CLANG_WARN_UNREACHABLE_CODE = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = NO; 289 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 290 | ENABLE_NS_ASSERTIONS = NO; 291 | ENABLE_STRICT_OBJC_MSGSEND = YES; 292 | GCC_C_LANGUAGE_STANDARD = gnu99; 293 | GCC_NO_COMMON_BLOCKS = YES; 294 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 296 | GCC_WARN_UNDECLARED_SELECTOR = YES; 297 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 298 | GCC_WARN_UNUSED_FUNCTION = YES; 299 | GCC_WARN_UNUSED_VARIABLE = YES; 300 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 301 | MTL_ENABLE_DEBUG_INFO = NO; 302 | SDKROOT = iphoneos; 303 | TARGETED_DEVICE_FAMILY = "1,2"; 304 | VALIDATE_PRODUCT = YES; 305 | }; 306 | name = Profile; 307 | }; 308 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 314 | DEVELOPMENT_TEAM = S8QB4VV633; 315 | ENABLE_BITCODE = NO; 316 | FRAMEWORK_SEARCH_PATHS = ( 317 | "$(inherited)", 318 | "$(PROJECT_DIR)/Flutter", 319 | ); 320 | INFOPLIST_FILE = Runner/Info.plist; 321 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 322 | LIBRARY_SEARCH_PATHS = ( 323 | "$(inherited)", 324 | "$(PROJECT_DIR)/Flutter", 325 | ); 326 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 327 | PRODUCT_NAME = "$(TARGET_NAME)"; 328 | VERSIONING_SYSTEM = "apple-generic"; 329 | }; 330 | name = Profile; 331 | }; 332 | 97C147031CF9000F007C117D /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 335 | buildSettings = { 336 | ALWAYS_SEARCH_USER_PATHS = NO; 337 | CLANG_ANALYZER_NONNULL = YES; 338 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 339 | CLANG_CXX_LIBRARY = "libc++"; 340 | CLANG_ENABLE_MODULES = YES; 341 | CLANG_ENABLE_OBJC_ARC = YES; 342 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 343 | CLANG_WARN_BOOL_CONVERSION = YES; 344 | CLANG_WARN_COMMA = YES; 345 | CLANG_WARN_CONSTANT_CONVERSION = YES; 346 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 347 | CLANG_WARN_EMPTY_BODY = YES; 348 | CLANG_WARN_ENUM_CONVERSION = YES; 349 | CLANG_WARN_INFINITE_RECURSION = YES; 350 | CLANG_WARN_INT_CONVERSION = YES; 351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 352 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 354 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 355 | CLANG_WARN_STRICT_PROTOTYPES = YES; 356 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 357 | CLANG_WARN_UNREACHABLE_CODE = YES; 358 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 359 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 360 | COPY_PHASE_STRIP = NO; 361 | DEBUG_INFORMATION_FORMAT = dwarf; 362 | ENABLE_STRICT_OBJC_MSGSEND = YES; 363 | ENABLE_TESTABILITY = YES; 364 | GCC_C_LANGUAGE_STANDARD = gnu99; 365 | GCC_DYNAMIC_NO_PIC = NO; 366 | GCC_NO_COMMON_BLOCKS = YES; 367 | GCC_OPTIMIZATION_LEVEL = 0; 368 | GCC_PREPROCESSOR_DEFINITIONS = ( 369 | "DEBUG=1", 370 | "$(inherited)", 371 | ); 372 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 373 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 374 | GCC_WARN_UNDECLARED_SELECTOR = YES; 375 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 376 | GCC_WARN_UNUSED_FUNCTION = YES; 377 | GCC_WARN_UNUSED_VARIABLE = YES; 378 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 379 | MTL_ENABLE_DEBUG_INFO = YES; 380 | ONLY_ACTIVE_ARCH = YES; 381 | SDKROOT = iphoneos; 382 | TARGETED_DEVICE_FAMILY = "1,2"; 383 | }; 384 | name = Debug; 385 | }; 386 | 97C147041CF9000F007C117D /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | TARGETED_DEVICE_FAMILY = "1,2"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 97C147061CF9000F007C117D /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 437 | buildSettings = { 438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 439 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 440 | ENABLE_BITCODE = NO; 441 | FRAMEWORK_SEARCH_PATHS = ( 442 | "$(inherited)", 443 | "$(PROJECT_DIR)/Flutter", 444 | ); 445 | INFOPLIST_FILE = Runner/Info.plist; 446 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 447 | LIBRARY_SEARCH_PATHS = ( 448 | "$(inherited)", 449 | "$(PROJECT_DIR)/Flutter", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | VERSIONING_SYSTEM = "apple-generic"; 454 | }; 455 | name = Debug; 456 | }; 457 | 97C147071CF9000F007C117D /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 460 | buildSettings = { 461 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 462 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 463 | ENABLE_BITCODE = NO; 464 | FRAMEWORK_SEARCH_PATHS = ( 465 | "$(inherited)", 466 | "$(PROJECT_DIR)/Flutter", 467 | ); 468 | INFOPLIST_FILE = Runner/Info.plist; 469 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 470 | LIBRARY_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "$(PROJECT_DIR)/Flutter", 473 | ); 474 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example; 475 | PRODUCT_NAME = "$(TARGET_NAME)"; 476 | VERSIONING_SYSTEM = "apple-generic"; 477 | }; 478 | name = Release; 479 | }; 480 | /* End XCBuildConfiguration section */ 481 | 482 | /* Begin XCConfigurationList section */ 483 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 484 | isa = XCConfigurationList; 485 | buildConfigurations = ( 486 | 97C147031CF9000F007C117D /* Debug */, 487 | 97C147041CF9000F007C117D /* Release */, 488 | 249021D3217E4FDB00AE95B9 /* Profile */, 489 | ); 490 | defaultConfigurationIsVisible = 0; 491 | defaultConfigurationName = Release; 492 | }; 493 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 494 | isa = XCConfigurationList; 495 | buildConfigurations = ( 496 | 97C147061CF9000F007C117D /* Debug */, 497 | 97C147071CF9000F007C117D /* Release */, 498 | 249021D4217E4FDB00AE95B9 /* Profile */, 499 | ); 500 | defaultConfigurationIsVisible = 0; 501 | defaultConfigurationName = Release; 502 | }; 503 | /* End XCConfigurationList section */ 504 | }; 505 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 506 | } 507 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #include "AppDelegate.h" 2 | #include "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/file_search_example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_file_utils/flutter_file_utils.dart'; 5 | import 'package:path_provider/path_provider.dart'; 6 | 7 | void main() => runApp(new FilesSearchApp()); 8 | 9 | class FilesSearchApp extends StatefulWidget { 10 | _FilesSearchStateApp createState() => _FilesSearchStateApp(); 11 | } 12 | 13 | class _FilesSearchStateApp extends State { 14 | final myController = TextEditingController(); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return MaterialApp( 19 | home: Scaffold( 20 | appBar: AppBar( 21 | title: DecoratedBox( 22 | decoration: BoxDecoration( 23 | color: Colors.white, 24 | ), 25 | child: TextField( 26 | autofocus: true, 27 | onChanged: (text) { 28 | setState(() {}); 29 | }, 30 | controller: myController, 31 | ), 32 | ), 33 | ), 34 | body: FutureBuilder( 35 | future: getfiles(myController.text), 36 | builder: (BuildContext context, AsyncSnapshot snapshot) { 37 | if (snapshot.connectionState == ConnectionState.done) { 38 | if (snapshot.data != null) { 39 | print("builder"); 40 | 41 | return ListView.builder( 42 | primary: false, 43 | itemCount: snapshot.data.length, 44 | itemBuilder: (context, index) { 45 | return ListTile( 46 | title: Container( 47 | decoration: BoxDecoration( 48 | border: Border(bottom: BorderSide())), 49 | child: Text(snapshot.data[index]))); 50 | }, 51 | ); 52 | } else 53 | return Center(child: Text("Nothing yet!")); 54 | } else if (snapshot.connectionState == ConnectionState.waiting) { 55 | return Center(child: Text("Loading")); 56 | } else if (snapshot.connectionState == ConnectionState.none) { 57 | return Center(child: Text("Nothing was found")); 58 | } 59 | return Container(); 60 | }), 61 | ), 62 | ); 63 | } 64 | 65 | Future getfiles(String searchString) async { 66 | var root = await getExternalStorageDirectory(); 67 | var fm = FileManager(root: root); 68 | return await fm.search(searchString).toList(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /example/lib/files_list_example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:io'; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:path_provider/path_provider.dart'; 6 | import 'package:flutter_file_utils/utils.dart'; 7 | 8 | 9 | void main() => runApp(new MyApp()); 10 | 11 | class MyApp extends StatefulWidget { 12 | _MyAppState createState() => _MyAppState(); 13 | } 14 | 15 | class _MyAppState extends State { 16 | @override 17 | Widget build(BuildContext context) { 18 | return MaterialApp( 19 | home: Scaffold( 20 | appBar: AppBar( 21 | title: Text("External Storage/DCIM/camera"), 22 | ), 23 | body: FutureBuilder( 24 | future: buildImages(), 25 | builder: (BuildContext context, AsyncSnapshot snapshot) { 26 | if (snapshot.connectionState == ConnectionState.done) { 27 | return GridView.builder( 28 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 29 | crossAxisCount: 3, 30 | crossAxisSpacing: 0.0, 31 | mainAxisSpacing: 0.0, 32 | ), 33 | primary: false, 34 | itemCount: 35 | snapshot.data.length, // equals the recents files length 36 | 37 | itemBuilder: (context, index) { 38 | return Image.file(snapshot.data[index]); 39 | }, 40 | ); 41 | } else if (snapshot.connectionState == ConnectionState.waiting) { 42 | return Text("Loading"); 43 | } 44 | return Container(); 45 | }), 46 | ), 47 | ); 48 | } 49 | 50 | Future buildImages() async { 51 | var root = await getExternalStorageDirectory(); 52 | List files = await listFiles(root.path + "/DCIM/", 53 | extensions: ["png", "jpg"]); 54 | 55 | return files; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /example/lib/files_tree_example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_file_utils/flutter_file_utils.dart'; 5 | import 'package:path_provider/path_provider.dart'; 6 | 7 | class MyFiles extends StatelessWidget { 8 | @override 9 | Widget build(BuildContext context) { 10 | return MaterialApp( 11 | home: Scaffold( 12 | appBar: AppBar( 13 | title: Text("External Storage: video files"), 14 | ), 15 | body: FutureBuilder( 16 | future: _getSpecificFileTypes(), 17 | builder: (BuildContext context, AsyncSnapshot snapshot) { 18 | if (snapshot.hasData) { 19 | return ListView.builder( 20 | primary: false, 21 | itemCount: snapshot.data.length, 22 | itemBuilder: (context, index) { 23 | return ListTile( 24 | title: Container( 25 | decoration: BoxDecoration( 26 | border: Border(bottom: BorderSide())), 27 | child: Text(snapshot.data[index].path))); 28 | }, 29 | ); 30 | } else if (snapshot.connectionState == ConnectionState.waiting) { 31 | return Text("Loading"); 32 | } 33 | return Container(); 34 | }), 35 | ), 36 | ); 37 | } 38 | // get all files that match these extensions 39 | Future _getSpecificFileTypes() async { 40 | var root = await getExternalStorageDirectory(); 41 | var files = await FileManager(root: root) 42 | .filesTree(extensions: ["txt", "3gp", "zip", "png"]); 43 | return files; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /example/lib/filtering_example.dart: -------------------------------------------------------------------------------- 1 | // dart files 2 | import 'dart:async'; 3 | import 'dart:io'; 4 | 5 | // framework 6 | import 'package:flutter/material.dart'; 7 | 8 | // packages 9 | import 'package:flutter_file_utils/flutter_file_utils.dart'; 10 | import 'package:path_provider/path_provider.dart'; 11 | import 'package:simple_permissions/simple_permissions.dart'; 12 | 13 | void main() => runApp(new HomePage()); 14 | 15 | class MyApp extends StatelessWidget { 16 | @override 17 | Widget build(BuildContext context) { 18 | return HomePage(); 19 | } 20 | } 21 | 22 | class HomePage extends StatefulWidget { 23 | _HomePageState createState() => _HomePageState(); 24 | } 25 | 26 | class _HomePageState extends State { 27 | @override 28 | Widget build(BuildContext context) { 29 | SimplePermissions.requestPermission(Permission.ReadExternalStorage); 30 | return MaterialApp( 31 | home: Scaffold( 32 | appBar: AppBar( 33 | title: Text("Flutter File Manager Example"), 34 | ), 35 | body: FutureBuilder( 36 | future: getFilteredPaths().toList(), 37 | builder: (BuildContext context, AsyncSnapshot snapshot) { 38 | if (snapshot.connectionState == ConnectionState.done) { 39 | return ListView.builder( 40 | itemCount: snapshot.data?.length ?? 0, 41 | itemBuilder: (context, index) { 42 | return ListTile( 43 | title: Text(snapshot.data[index].path.split('/').last), 44 | ); 45 | }, 46 | ); 47 | } else if (snapshot.connectionState == ConnectionState.waiting) { 48 | return Center(child: Text("Loading")); 49 | } 50 | return Container(); 51 | }), 52 | ), 53 | ); 54 | } 55 | 56 | Stream getFilteredPaths() async* { 57 | var root = await getExternalStorageDirectory(); 58 | yield* FileManager( 59 | root: root, 60 | filter: SimpleFileFilter( 61 | allowedExtensions: ["png", 'apk'], includeHidden: false)) 62 | .walk(); 63 | } 64 | 65 | // Future _search() async { 66 | // var root = await getExternalStorageDirectory(); 67 | // var fm = FileManager( 68 | // root: root, 69 | // ); 70 | 71 | // List founds = await fm 72 | // .search( 73 | // // search keyword 74 | // "android", 75 | // searchFilter: 76 | // SimpleFileFilter(allowedExtensions: ['png'], fileOnly: true), 77 | // sortedBy: FileManagerSorting.Size, 78 | // ) 79 | // .toList(); 80 | 81 | // return founds; 82 | // } 83 | } 84 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | // framework 2 | import 'dart:async'; 3 | 4 | import 'package:flutter/material.dart'; 5 | 6 | // packages 7 | import 'package:flutter_file_utils/flutter_file_utils.dart'; 8 | import 'package:flutter_file_utils/utils.dart'; 9 | 10 | import 'package:path/path.dart' as p; 11 | 12 | void main() => runApp(new MyApp()); 13 | 14 | @immutable 15 | class MyApp extends StatelessWidget { 16 | @override 17 | Widget build(BuildContext context) { 18 | return new MaterialApp( 19 | home: Scaffold( 20 | appBar: AppBar( 21 | title: Text("Flutter File Manager Demo"), 22 | ), 23 | body: FutureBuilder( 24 | future: _search(), 25 | builder: (BuildContext context, AsyncSnapshot snapshot) { 26 | switch (snapshot.connectionState) { 27 | case ConnectionState.none: 28 | return Center(child: Text('Press button to start.')); 29 | case ConnectionState.active: 30 | return Center(child: Text('Active')); 31 | case ConnectionState.waiting: 32 | return Center(child: Text('Awaiting result...')); 33 | case ConnectionState.done: 34 | if (snapshot.hasError) 35 | return Text('Error: ${snapshot.error}'); 36 | return snapshot.data != null 37 | ? ListView.builder( 38 | itemCount: snapshot.data.length, 39 | itemBuilder: (context, index) => Card( 40 | child: ListTile( 41 | title: Column(children: [ 42 | Text('Size: ' + 43 | snapshot.data[index] 44 | .statSync() 45 | .size 46 | .toString()), 47 | Text('Path: ' + 48 | snapshot.data[index].path.toString()), 49 | Text('Date: ' + 50 | snapshot.data[index] 51 | .statSync() 52 | .modified 53 | .toUtc() 54 | .toString()) 55 | ]), 56 | 57 | subtitle: Text( 58 | "Extension: ${p.extension(snapshot.data[index].absolute.path).replaceFirst('.', '')}"), // getting extension 59 | ))) 60 | : Center( 61 | child: Text("Nothing!"), 62 | ); 63 | } 64 | return null; // unreachable 65 | }, 66 | )), 67 | ); 68 | } 69 | 70 | Future _search() async { 71 | var root = await getStorageList(); 72 | var fm = FileManager( 73 | root: root[1], 74 | ); 75 | 76 | List founds = await fm 77 | .search( 78 | // search keyword 79 | "android", 80 | sortedBy: FlutterFileUtilsSorting.Size, 81 | ) 82 | .toList(); 83 | return founds; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /example/lib/permissions.txt: -------------------------------------------------------------------------------- 1 | Add these permissions to AndroidManifest.xml 2 | 3 | 4 | -------------------------------------------------------------------------------- /example/lib/recent_files_example.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:path_provider/path_provider.dart'; 5 | import 'package:flutter_file_utils/flutter_file_utils.dart'; 6 | 7 | void main() => runApp(new MyApp()); 8 | 9 | class MyApp extends StatefulWidget { 10 | _MyAppState createState() => _MyAppState(); 11 | } 12 | 13 | class _MyAppState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return MaterialApp( 17 | home: Scaffold( 18 | body: FutureBuilder( 19 | future: buildImages(), 20 | builder: (BuildContext context, AsyncSnapshot snapshot) { 21 | if (snapshot.connectionState == ConnectionState.done) { 22 | return GridView.builder( 23 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 24 | crossAxisCount: 3, 25 | crossAxisSpacing: 0.0, 26 | mainAxisSpacing: 0.0, 27 | ), 28 | primary: false, 29 | itemCount: snapshot.data.length, 30 | 31 | itemBuilder: (context, index) { 32 | return Image.file(snapshot.data[index]); 33 | }, 34 | ); 35 | } else if (snapshot.connectionState == ConnectionState.waiting) { 36 | return Text("Loading"); 37 | } 38 | return Container(); 39 | }), 40 | ), 41 | ); 42 | } 43 | 44 | Future buildImages() async { 45 | var root = await getExternalStorageDirectory(); 46 | var files = 47 | await FileManager(root: root).filesTree(extensions: ["png", "jpg"]); 48 | 49 | return files; 50 | } 51 | } -------------------------------------------------------------------------------- /example/lib/sorting_example.dart: -------------------------------------------------------------------------------- 1 | // framework 2 | import 'package:flutter/material.dart'; 3 | 4 | // packages 5 | import 'package:flutter_file_utils/flutter_file_utils.dart'; 6 | import 'package:path_provider/path_provider.dart'; 7 | import 'package:path/path.dart' as p; 8 | 9 | void main() => runApp(new MyApp()); 10 | 11 | @immutable 12 | class MyApp extends StatelessWidget { 13 | @override 14 | Widget build(BuildContext context) { 15 | return new MaterialApp( 16 | home: Scaffold( 17 | appBar: AppBar( 18 | title: Text("Flutter File Manager Demo"), 19 | ), 20 | body: FutureBuilder( 21 | future: _files(), // a previously-obtained Future or null 22 | builder: (BuildContext context, AsyncSnapshot snapshot) { 23 | switch (snapshot.connectionState) { 24 | case ConnectionState.none: 25 | return Text('Press button to start.'); 26 | case ConnectionState.active: 27 | case ConnectionState.waiting: 28 | return Text('Awaiting result...'); 29 | case ConnectionState.done: 30 | if (snapshot.hasError) 31 | return Text('Error: ${snapshot.error}'); 32 | return snapshot.data != null 33 | ? ListView.builder( 34 | itemCount: snapshot.data.length, 35 | itemBuilder: (context, index) => Card( 36 | child: ListTile( 37 | title: Column(children: [ 38 | Text('Size: ' + 39 | snapshot.data[index] 40 | .statSync() 41 | .size 42 | .toString()), 43 | Text('Path' + 44 | snapshot.data[index].path.toString()), 45 | Text('Date' + 46 | snapshot.data[index] 47 | .statSync() 48 | .modified 49 | .toUtc() 50 | .toString()) 51 | ]), 52 | 53 | subtitle: Text( 54 | "Extension: ${p.extension(snapshot.data[index].absolute.path).replaceFirst('.', '')}"), // getting extension 55 | ))) 56 | : Center( 57 | child: Text("Nothing!"), 58 | ); 59 | } 60 | return null; // unreachable 61 | }, 62 | )), 63 | ); 64 | } 65 | 66 | _files() async { 67 | var root = await getExternalStorageDirectory(); 68 | var fm = FileManager(root: root); 69 | 70 | List founds = await fm.recentFilesAndDirs(20, 71 | sortedBy: FlutterFileUtilsSorting.Size, reversed: false); 72 | 73 | return founds; 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_file_utils: 66 | dependency: "direct overridden" 67 | description: 68 | path: ".." 69 | relative: true 70 | source: path 71 | version: "0.2.0" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | image: 78 | dependency: transitive 79 | description: 80 | name: image 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "2.1.4" 84 | matcher: 85 | dependency: transitive 86 | description: 87 | name: matcher 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "0.12.6" 91 | meta: 92 | dependency: transitive 93 | description: 94 | name: meta 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "1.1.8" 98 | package_info: 99 | dependency: transitive 100 | description: 101 | name: package_info 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "0.4.0+13" 105 | path: 106 | dependency: "direct main" 107 | description: 108 | name: path 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.6.4" 112 | path_provider: 113 | dependency: "direct main" 114 | description: 115 | name: path_provider 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.5.1" 119 | pedantic: 120 | dependency: transitive 121 | description: 122 | name: pedantic 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "1.8.0+1" 126 | petitparser: 127 | dependency: transitive 128 | description: 129 | name: petitparser 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "2.4.0" 133 | platform: 134 | dependency: transitive 135 | description: 136 | name: platform 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.2.1" 140 | quiver: 141 | dependency: transitive 142 | description: 143 | name: quiver 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "2.0.5" 147 | simple_permissions: 148 | dependency: "direct main" 149 | description: 150 | name: simple_permissions 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.1.9" 154 | sky_engine: 155 | dependency: transitive 156 | description: flutter 157 | source: sdk 158 | version: "0.0.99" 159 | source_span: 160 | dependency: transitive 161 | description: 162 | name: source_span 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "1.5.5" 166 | stack_trace: 167 | dependency: transitive 168 | description: 169 | name: stack_trace 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.9.3" 173 | stream_channel: 174 | dependency: transitive 175 | description: 176 | name: stream_channel 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "2.0.0" 180 | string_scanner: 181 | dependency: transitive 182 | description: 183 | name: string_scanner 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "1.0.5" 187 | term_glyph: 188 | dependency: transitive 189 | description: 190 | name: term_glyph 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.1.0" 194 | test_api: 195 | dependency: transitive 196 | description: 197 | name: test_api 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "0.2.11" 201 | typed_data: 202 | dependency: transitive 203 | description: 204 | name: typed_data 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "1.1.6" 208 | vector_math: 209 | dependency: transitive 210 | description: 211 | name: vector_math 212 | url: "https://pub.dartlang.org" 213 | source: hosted 214 | version: "2.0.8" 215 | xml: 216 | dependency: transitive 217 | description: 218 | name: xml 219 | url: "https://pub.dartlang.org" 220 | source: hosted 221 | version: "3.5.0" 222 | sdks: 223 | dart: ">=2.4.0 <3.0.0" 224 | flutter: ">=1.10.0 <2.0.0" 225 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | version: 1.0.0 4 | homepage: https://github.com/Eagle6789/flutter_file_utils 5 | author: Mohamed Naga 6 | 7 | environment: 8 | sdk: ">=2.0.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | simple_permissions: ^0.1.9 14 | path: '>=1.5.1 <3.0.0' 15 | path_provider: '>=0.4.0 <3.0.0' 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | dependency_overrides: 22 | flutter_file_utils: 23 | path: ../ -------------------------------------------------------------------------------- /flutter_file_utils.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /lib/flutter_file_utils.dart: -------------------------------------------------------------------------------- 1 | library flutter_file_utils; 2 | 3 | // exporting everything from this dart file 4 | export 'src/sorting.dart'; 5 | 6 | // exporting everything from this dart file 7 | export 'src/file_manager.dart'; 8 | 9 | // filters 10 | export 'src/filter.dart'; 11 | 12 | export 'src/io_extensions.dart'; 13 | 14 | export 'src/exceptions.dart'; 15 | -------------------------------------------------------------------------------- /lib/src/exceptions.dart: -------------------------------------------------------------------------------- 1 | class FileManagerError extends Error { 2 | final String message; 3 | FileManagerError(this.message); 4 | 5 | @override 6 | String toString() { 7 | return message; 8 | } 9 | } 10 | 11 | class NotValidExtensionError extends Error { 12 | final String message; 13 | NotValidExtensionError(this.message); 14 | 15 | @override 16 | String toString() { 17 | return "Not valid extension: $message"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lib/src/file_manager.dart: -------------------------------------------------------------------------------- 1 | // dart 2 | import 'dart:async'; 3 | import 'dart:io'; 4 | 5 | // packages 6 | import 'package:path/path.dart' as p; 7 | 8 | // local files 9 | import 'sorting.dart'; 10 | import 'filter.dart'; 11 | import 'file_system_utils.dart'; 12 | import 'exceptions.dart'; 13 | 14 | final String permissionMessage = ''' 15 | \n 16 | Try to add thes lines to your AndroidManifest.xml file 17 | 18 | `` 19 | `` 20 | 21 | and grant storage permissions to your applicaion from app settings 22 | \n 23 | '''; 24 | 25 | class FileManager { 26 | // The start point . 27 | Directory root; 28 | 29 | FileFilter filter; 30 | 31 | FileManager({this.root, this.filter}) : assert(root != null); 32 | 33 | /// * This function returns a [List] of [int howMany] of type [File] of recently created files. 34 | /// * [excludeHidded] if [true] hidden files will not be returned 35 | /// * sortedBy: [Sorting] 36 | /// * [bool] reversed: in case parameter sortedBy is used 37 | Future> recentFilesAndDirs(int count, 38 | {List extensions, 39 | List excludedPaths, 40 | excludeHidden: false, 41 | FlutterFileUtilsSorting sortedBy, 42 | bool reversed: false}) async { 43 | List filesPaths = await filesTree( 44 | excludedPaths: excludedPaths, 45 | extensions: extensions, 46 | excludeHidden: excludeHidden); 47 | 48 | // note: in case that number of recent files are not sufficient, we limit the [howMany] 49 | // to the number of the found ones 50 | if (filesPaths.length < count) count = filesPaths.length; 51 | 52 | var _sorted = 53 | sortBy(filesPaths, FlutterFileUtilsSorting.Date, reversed: true); 54 | 55 | // decrease length to howMany 56 | _sorted = _sorted.getRange(0, count).toList(); 57 | 58 | if (sortedBy != null) { 59 | return sortBy(filesPaths, sortedBy, reversed: reversed); 60 | } 61 | 62 | return _sorted; 63 | } 64 | 65 | /// Return list tree of directories. 66 | /// You may exclude some directories from the list. 67 | /// * [excludedPaths] will excluded paths and their subpaths from the final [list] 68 | /// * sortedBy: [FlutterFileUtilsSorting] 69 | /// * [bool] reversed: in case parameter sortedBy is used 70 | Future> dirsTree( 71 | {List excludedPaths, 72 | bool followLinks: false, 73 | bool excludeHidden: false, 74 | FlutterFileUtilsSorting sortedBy}) async { 75 | List dirs = []; 76 | 77 | try { 78 | var contents = root.listSync(recursive: true, followLinks: followLinks); 79 | if (excludedPaths != null) { 80 | for (var fileOrDir in contents) { 81 | if (fileOrDir is Directory) { 82 | for (var excludedPath in excludedPaths) { 83 | if (!p.isWithin(excludedPath, p.normalize(fileOrDir.path))) { 84 | if (!excludeHidden) { 85 | dirs.add(Directory(p.normalize(fileOrDir.absolute.path))); 86 | } else { 87 | if (!fileOrDir.absolute.path.contains(RegExp(r"\.[\w]+"))) { 88 | dirs.add(Directory(p.normalize(fileOrDir.absolute.path))); 89 | } 90 | } 91 | } 92 | } 93 | } 94 | } 95 | } else { 96 | for (var fileOrDir in contents) { 97 | if (fileOrDir is Directory) { 98 | if (!excludeHidden) { 99 | dirs.add(Directory(p.normalize(fileOrDir.absolute.path))); 100 | } else { 101 | // The Regex below is used to check if the directory contains 102 | // ".file" in pathe 103 | if (!fileOrDir.absolute.path.contains(RegExp(r"\.[\w]+"))) { 104 | dirs.add(Directory(p.normalize(fileOrDir.absolute.path))); 105 | } 106 | } 107 | } 108 | } 109 | } 110 | } catch (error) { 111 | throw FileManagerError(permissionMessage + error.toString()); 112 | } 113 | if (dirs != null) { 114 | return sortBy(dirs, sortedBy); 115 | } 116 | 117 | return dirs; 118 | } 119 | 120 | /// Return tree [List] of files starting from the root of type [File] 121 | /// * [excludedPaths] example: '/storage/emulated/0/Android' no files will be 122 | /// returned from this path, and its sub directories 123 | /// * sortedBy: [Sorting] 124 | /// * [bool] reversed: in case parameter sortedBy is used 125 | Future> filesTree( 126 | {List extensions, 127 | List excludedPaths, 128 | excludeHidden = false, 129 | bool reversed: false, 130 | FlutterFileUtilsSorting sortedBy}) async { 131 | List files = []; 132 | 133 | List dirs = await dirsTree( 134 | excludedPaths: excludedPaths, excludeHidden: excludeHidden); 135 | 136 | dirs.insert(0, Directory(root.path)); 137 | 138 | if (extensions != null) { 139 | for (var dir in dirs) { 140 | for (var file 141 | in await listFiles(dir.absolute.path, extensions: extensions)) { 142 | if (excludeHidden) { 143 | if (!file.path.startsWith(".")) 144 | files.add(file); 145 | else 146 | print("Excluded: ${file.path}"); 147 | } else { 148 | files.add(file); 149 | } 150 | } 151 | } 152 | } else { 153 | for (var dir in dirs) { 154 | for (var file in await listFiles(dir.absolute.path)) { 155 | if (excludeHidden) { 156 | if (!file.path.startsWith(".")) 157 | files.add(file); 158 | else 159 | print("Excluded: ${file.path}"); 160 | } else { 161 | files.add(file); 162 | } 163 | } 164 | } 165 | } 166 | 167 | if (sortedBy != null) { 168 | return sortBy(files, sortedBy); 169 | } 170 | 171 | return files; 172 | } 173 | 174 | /// Return tree [List] of files starting from the root of type [File]. 175 | /// 176 | /// This function uses filter 177 | Stream walk({followLinks: false}) async* { 178 | if (filter != null) { 179 | try { 180 | yield* Directory(root.path) 181 | .list(recursive: true, followLinks: followLinks) 182 | .transform(StreamTransformer.fromHandlers( 183 | handleData: (FileSystemEntity fileOrDir, EventSink eventSink) { 184 | if (filter.isValid(fileOrDir.absolute.path, root.absolute.path)) { 185 | eventSink.add(fileOrDir); 186 | } 187 | })); 188 | } catch (error) { 189 | throw FileManagerError(permissionMessage + error.toString()); 190 | } 191 | } else { 192 | print("Flutter File Manager: walk: No filter"); 193 | yield* Directory(root.path) 194 | .list(recursive: true, followLinks: followLinks); 195 | } 196 | } 197 | 198 | /// Returns a list of found items of [Directory] or [File] type or empty list. 199 | /// You may supply `Regular Expression` e.g: "*\.png", instead of string. 200 | /// * [filesOnly] if set to [true] return only files 201 | /// * [dirsOnly] if set to [true] return only directories 202 | /// * You can set both to [true] 203 | /// * sortedBy: [Sorting] 204 | /// * [bool] reversed: in case parameter sortedBy is used 205 | /// * Example: 206 | /// * List imagesPaths = await FileManager.search("myFile.png"); 207 | Future> searchFuture( 208 | var keyword, { 209 | List excludedPaths, 210 | filesOnly = false, 211 | dirsOnly = false, 212 | List extensions, 213 | bool reversed: false, 214 | FlutterFileUtilsSorting sortedBy, 215 | }) async { 216 | print("Searching for: $keyword"); 217 | // files that will be returned 218 | List founds = []; 219 | 220 | if (keyword.length == 0 || keyword == null) { 221 | throw Exception("search keyword == null"); 222 | } 223 | 224 | List dirs = await dirsTree(excludedPaths: excludedPaths); 225 | List files = 226 | await filesTree(excludedPaths: excludedPaths, extensions: extensions); 227 | 228 | if (filesOnly == false && dirsOnly == false) { 229 | filesOnly = true; 230 | dirsOnly = true; 231 | } 232 | if (extensions.isNotEmpty) dirsOnly = false; 233 | // in the future fileAndDirTree will be used 234 | // searching in files 235 | if (dirsOnly == true) { 236 | for (var dir in dirs) { 237 | if (dir.absolute.path.contains(keyword)) { 238 | founds.add(dir); 239 | } 240 | } 241 | } 242 | // searching in files 243 | 244 | if (filesOnly == true) { 245 | for (var file in files) { 246 | if (file.absolute.path.contains(keyword)) { 247 | founds.add(file); 248 | } 249 | } 250 | } 251 | 252 | // sorting 253 | if (sortedBy != null) { 254 | return sortBy(founds, sortedBy); 255 | } 256 | return founds; 257 | } 258 | 259 | /// Returns a list of found items of [Directory] or [File] type or empty list. 260 | /// You may supply `Regular Expression` e.g: "*\.png", instead of string. 261 | /// * [filesOnly] if set to [true] return only files 262 | /// * [dirsOnly] if set to [true] return only directories 263 | /// * You can set both to [true] 264 | /// * sortedBy: [FlutterFileUtilsSorting] 265 | /// * [bool] reverse: in case parameter sortedBy is used 266 | /// * Example: 267 | /// * `List imagesPaths = await FileManager.search("myFile.png").toList();` 268 | Stream search( 269 | var keyword, { 270 | FileFilter searchFilter, 271 | FlutterFileUtilsSorting sortedBy, 272 | }) async* { 273 | try { 274 | if (keyword.length == 0 || keyword == null) { 275 | throw FileManagerError("search keyword == null"); 276 | } 277 | if (searchFilter != null) { 278 | print("Using default filter"); 279 | yield* root.list(recursive: true, followLinks: true).where((test) { 280 | if (searchFilter.isValid(test.absolute.path, root.absolute.path)) { 281 | return getBaseName(test.path, extension: true).contains(keyword); 282 | } 283 | return false; 284 | }); 285 | } else if (filter != null) { 286 | print("Using default filter"); 287 | yield* root.list(recursive: true, followLinks: true).where((test) { 288 | if (filter.isValid(test.absolute.path, root.absolute.path)) { 289 | return getBaseName(test.path, extension: true).contains(keyword); 290 | } 291 | return false; 292 | }); 293 | } else { 294 | yield* root.list(recursive: true, followLinks: true).where((test) => 295 | getBaseName(test.path, extension: true).contains(keyword)); 296 | } 297 | } on FileSystemException catch (e) { 298 | throw FileManagerError(permissionMessage + ' ' + e.toString()); 299 | } catch (e) { 300 | throw FileManagerError(e.toString()); 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /lib/src/file_system_utils.dart: -------------------------------------------------------------------------------- 1 | // dart 2 | import 'dart:io'; 3 | import 'dart:async'; 4 | import 'dart:collection'; 5 | 6 | // packages 7 | import 'package:path/path.dart' as pathlib; 8 | 9 | // local 10 | import 'exceptions.dart'; 11 | import 'sorting.dart'; 12 | import 'time_tools.dart'; 13 | import 'io_extensions.dart'; 14 | import 'package:path_provider/path_provider.dart'; 15 | import 'file_manager.dart'; 16 | 17 | // returns [File] or [Directory] 18 | /// * argument objects = [File] or [Directory] 19 | /// * argument by [String]: 'date', 'alpha', 'size' 20 | List sortBy(List objects, FlutterFileUtilsSorting by, 21 | {bool reversed: false}) { 22 | switch (by) { 23 | case FlutterFileUtilsSorting.Alpha: 24 | objects 25 | .sort((a, b) => getBaseName(a.path).compareTo(getBaseName(b.path))); 26 | break; 27 | 28 | case FlutterFileUtilsSorting.Date: 29 | objects.sort((a, b) { 30 | return a 31 | .statSync() 32 | .modified 33 | .millisecondsSinceEpoch 34 | .compareTo(b.statSync().modified.millisecondsSinceEpoch); 35 | }); 36 | break; 37 | 38 | case FlutterFileUtilsSorting.Size: 39 | objects.sort((a, b) { 40 | return a.statSync().size.compareTo(b.statSync().size); 41 | }); 42 | break; 43 | 44 | case FlutterFileUtilsSorting.Type: 45 | objects.sort((a, b) { 46 | return pathlib.extension(a.path).compareTo(pathlib.extension(b.path)); 47 | }); 48 | 49 | break; 50 | default: 51 | objects 52 | .sort((a, b) => getBaseName(a.path).compareTo(getBaseName(b.path))); 53 | } 54 | if (reversed == true) { 55 | return objects.reversed.toList(); 56 | } 57 | return objects; 58 | } 59 | 60 | /// Return the name of the file or the folder 61 | /// i.e: /root/home/myfile.zip = myfile.zip 62 | /// [extension]: with extension [true] or not [false], [true] 63 | /// by default 64 | String getBaseName(String path, {bool extension: true}) { 65 | if (extension) { 66 | return pathlib.split(path).last; 67 | } else { 68 | return pathlib.split(path).last.split(new RegExp(r'\.\w+'))[0]; 69 | } 70 | } 71 | 72 | /// Returns a [HashMap] containing detials of the file or the directory 73 | /// in organised style. you can use details from [Directory] or 74 | /// [File] instead this function. 75 | /// ### arguments 76 | /// * [path] should be of [File] or [Directory] 77 | /// 78 | /// ### keys 79 | /// * type 80 | /// * lastChanged 81 | /// * lastModified 82 | /// * size 83 | /// * permissions 84 | /// * lastAccessed 85 | /// * extension 86 | /// * path 87 | Future details(dynamic path) async { 88 | HashMap _details = HashMap(); 89 | if (path == null || (!path.existsSync() && !File(path).existsSync())) { 90 | print("file or dir does not exists"); 91 | return null; 92 | // directory 93 | } else if (path.existsSync()) { 94 | // directory or file 95 | _details["type"] = path.statSync().type.toString(); 96 | _details["lastChanged"] = TimeTools.timeNormalize(path.statSync().changed); 97 | _details["lastModified"] = TimeTools.timeNormalize( 98 | Directory.fromUri(Uri.parse(path)).statSync().modified); 99 | _details["size"] = path.statSync().size; 100 | _details["type"] = path.statSync().type.toString(); 101 | _details["lastAccessed"] = 102 | TimeTools.timeNormalize(path.statSync().accessed); 103 | _details["permissions"] = path.statSync().modeString(); 104 | _details["path"] = path; 105 | 106 | return _details; 107 | // file 108 | } else if (File(path).existsSync()) { 109 | var fileStat = File(path).statSync(); 110 | // directory or file 111 | _details["lastModified"] = TimeTools.timeNormalize(fileStat.modified); 112 | _details["lastAccessed"] = TimeTools.timeNormalize(fileStat.accessed); 113 | _details["lastChanged"] = TimeTools.timeNormalize(fileStat.changed); 114 | _details["type"] = fileStat.type.toString(); 115 | _details["size"] = fileStat.size; 116 | _details["permissions"] = fileStat.modeString(); 117 | _details["extension"] = pathlib.extension(path.path).replaceFirst('.', ''); 118 | _details["path"] = path; 119 | 120 | return _details; 121 | } 122 | return null; 123 | } 124 | 125 | bool isHidden(String path, String root) { 126 | // trying to infer relative path 127 | if (pathlib.relative(path, from: root).startsWith('.')) { 128 | return true; 129 | } else { 130 | return false; 131 | } 132 | } 133 | 134 | /// keepHidden: show files that start with . 135 | Stream> fileStream(String path, 136 | {changeCurrentPath: true, 137 | reverse: false, 138 | recursive: false, 139 | keepHidden: false}) async* { 140 | Directory _path = Directory(path); 141 | List _files = List(); 142 | try { 143 | // Checking if the target directory contains files inside or not! 144 | // so that [StreamBuilder] won't emit the same old data if there are 145 | // no elements inside that directory. 146 | if (_path.listSync(recursive: recursive).length != 0) { 147 | if (!keepHidden) { 148 | yield* _path.list(recursive: recursive).transform( 149 | StreamTransformer.fromHandlers( 150 | handleData: (FileSystemEntity data, sink) { 151 | print("filsytem_utils -> fileStream: $data"); 152 | _files.add(data); 153 | sink.add(_files); 154 | })); 155 | } else { 156 | yield* _path.list(recursive: recursive).transform( 157 | StreamTransformer.fromHandlers( 158 | handleData: (FileSystemEntity data, sink) { 159 | print("filsytem_utils -> fileStream: $data"); 160 | if (data.basename().startsWith('.')) { 161 | _files.add(data); 162 | sink.add(_files); 163 | } 164 | })); 165 | } 166 | } else { 167 | yield []; 168 | } 169 | } on FileSystemException catch (e) { 170 | print(e); 171 | yield []; 172 | } 173 | } 174 | 175 | /// search for files and folder in current directory & sub-directories, 176 | /// and return [File] or [Directory] 177 | /// 178 | /// `path`: start point 179 | /// `query`: regex or simple string 180 | Stream> searchStream(dynamic path, String query, 181 | {bool matchCase: false, recursive: true, bool hidden: false}) async* { 182 | yield* fileStream(path, recursive: recursive) 183 | .transform(StreamTransformer.fromHandlers(handleData: (data, sink) { 184 | // Filtering 185 | data.retainWhere( 186 | (test) => test.basename().toLowerCase().contains(query.toLowerCase())); 187 | sink.add(data); 188 | })); 189 | } 190 | 191 | // Future getFreeSpace(String path) async { 192 | // MethodChannel platform = const MethodChannel('samples.flutter.dev/battery'); 193 | // int freeSpace = await platform.invokeMethod("getFreeStorageSpace"); 194 | // return freeSpace; 195 | // } 196 | 197 | /// Create folder by path 198 | /// * i.e: `.createFolderByPath("/storage/emulated/0/", "folder name" )` 199 | /// 200 | /// Supply path alone to create by already combined path, or path + filename 201 | /// to be combined 202 | Future createFolderByPath(String path, {String folderName}) async { 203 | print("filesystem_utils->createFolderByPath: $folderName @ $path"); 204 | var _directory; 205 | 206 | if (folderName != null) { 207 | _directory = Directory(pathlib.join(path, folderName)); 208 | } else { 209 | _directory = Directory(path); 210 | } 211 | 212 | try { 213 | if (!_directory.existsSync()) { 214 | _directory.create(); 215 | } else { 216 | FileSystemException("File already exists"); 217 | } 218 | return _directory; 219 | } catch (e) { 220 | throw FileSystemException(e); 221 | } 222 | } 223 | 224 | /// This function returns every [Directory] in the path 225 | /// independently 226 | /// 227 | /// e.g: 228 | /// 229 | /// path: /lib/user/share/var/foo 230 | /// * `Directory: /` 231 | /// * `Directory: /lib/` 232 | /// * `Directory: /lib/user` 233 | /// * `Directory: /lib/user/share` 234 | /// * `....` 235 | List splitPathToDirectories(String fullPath) { 236 | List splittedPath = List(); 237 | Directory fullPathDir = Directory(fullPath); 238 | splittedPath.add(fullPathDir); 239 | for (int i = 0; i == pathlib.split(fullPath).length; i++) { 240 | splittedPath.add(fullPathDir.parent); 241 | fullPathDir = fullPathDir.parent; 242 | } 243 | return splittedPath.reversed.toList(); 244 | } 245 | 246 | void copy(String targetPath, String destination) { 247 | Directory targetDir = Directory(targetPath); 248 | try { 249 | print("Trying Copying directory: $targetPath"); 250 | if (targetDir.existsSync()) { 251 | print("Target path exists, copying directory..."); 252 | String targetBasename = pathlib.basename(targetPath); 253 | 254 | // Create target 255 | Directory newPath = Directory(pathlib.join(destination, targetBasename)) 256 | ..create(); 257 | for (var fileOrDir in targetDir.listSync()) { 258 | // if it was file 259 | if (fileOrDir is File) { 260 | print("Copying file: ${fileOrDir.path} to ${newPath.path}\n"); 261 | fileOrDir.copy( 262 | pathlib.join(newPath.path, pathlib.basename(fileOrDir.path))); 263 | } else if (fileOrDir is Directory) { 264 | print("Copying directory: ${fileOrDir.path} to ${newPath.path}\n"); 265 | // recursion 266 | copy(fileOrDir.path, newPath.path); 267 | } 268 | // if ? is link then ... 269 | else { 270 | fileOrDir.rename( 271 | pathlib.join(newPath.path, pathlib.basename(fileOrDir.path))); 272 | } 273 | } 274 | } else { 275 | throw FileSystemException("Target does not exist", targetPath); 276 | } 277 | } catch (e) { 278 | rethrow; 279 | } 280 | } 281 | 282 | Future rename(String target, String destination) async { 283 | Directory targetDir = Directory(target); 284 | String basename = pathlib.basename(targetDir.path); 285 | return await targetDir.rename(pathlib.join(destination, basename)); 286 | } 287 | 288 | /// This function creates temporary file on the device storage 289 | /// Return [File] 290 | /// You can call normal [File] methods 291 | Future cacheFile(String name) async { 292 | Directory tempDir = await getTemporaryDirectory(); 293 | return File(pathlib.join(tempDir.path, name)); 294 | } 295 | 296 | /// This function returns files' paths list only from specific location. 297 | /// * You may specify the types of the files you want to get by supplying the optional 298 | /// [extensions]. 299 | /// * sortedBy: [FlutterFileUtilsSorting] 300 | /// * [bool] reversed: in case parameter sortedBy is used 301 | Future> listFiles(String path, 302 | {List extensions, 303 | followsLinks = false, 304 | excludeHidden = false, 305 | FlutterFileUtilsSorting sortedBy, 306 | bool reversed: false}) async { 307 | List files = []; 308 | 309 | try { 310 | List contents = 311 | Directory(path).listSync(followLinks: followsLinks, recursive: false); 312 | if (extensions != null) { 313 | // Future> extensionsPatterns = 314 | // RegexTools.makeExtensionPatterns(extensions); 315 | for (var fileOrDir in contents) { 316 | if (fileOrDir is File) { 317 | String file = pathlib.normalize(fileOrDir.path); 318 | for (var extension in extensions) { 319 | if (pathlib.extension(file).replaceFirst(".", "") == 320 | extension.replaceFirst('.', '')) { 321 | if (excludeHidden) { 322 | if (file.startsWith('.')) 323 | files.add(File(pathlib.normalize(fileOrDir.absolute.path))); 324 | } else { 325 | files.add(File(pathlib.normalize(fileOrDir.absolute.path))); 326 | } 327 | } 328 | } 329 | } 330 | } 331 | } else { 332 | for (var fileOrDir in contents) { 333 | if (fileOrDir is File) { 334 | files.add(File(pathlib.normalize(fileOrDir.absolute.path))); 335 | } 336 | } 337 | } 338 | } catch (error) { 339 | throw FileManagerError(error.toString()); 340 | } 341 | if (files != null) { 342 | return sortBy(files, sortedBy, reversed: reversed); 343 | } 344 | 345 | return files; 346 | } 347 | 348 | /// This function return list of folders of type [String] , not full paths [Directory]. 349 | /// 350 | /// e.g: listFolders(Directory("/")) = root, usr, var, proc, mnt ... 351 | /// * [hidden]: this parameter excludes folders starts with " . " 352 | /// * [excludedFolders]: this parameter excludes folders from the result 353 | /// * sortedBy: [Sorting] 354 | /// * [bool] reversed: in case parameter sortedBy is used 355 | /// * examples: ["Android", "Download", "DCIM", ....] 356 | Future> listFolders(Directory path, 357 | {List excludedFolders, 358 | List excludedPaths, 359 | bool excludeHidden: false, 360 | followLinks: false, 361 | FlutterFileUtilsSorting sortedBy, 362 | bool reversed: false}) async { 363 | List folders = (await listDirectories(path, 364 | excludeHidden: excludeHidden, 365 | followLinks: false, 366 | reversed: reversed, 367 | sortedBy: sortedBy)) 368 | .map((Directory directory) => pathlib.split(directory.absolute.path).last) 369 | .toList(); 370 | return folders; 371 | } 372 | 373 | /// Return a [List] of directories starting from the given path 374 | /// * [hidden] : [true] or [false] return hidden directory, like: "/storage/.thumbnails" 375 | /// * [true] will return hidden directories 376 | /// * sortedBy: [Sorting] 377 | /// * [bool] reversed: in case parameter sortedBy is used 378 | Future> listDirectories(Directory path, 379 | {excludeHidden: false, 380 | followLinks = false, 381 | FlutterFileUtilsSorting sortedBy, 382 | bool reversed: false}) async { 383 | List directories = []; 384 | try { 385 | List contents = path.listSync(followLinks: followLinks, recursive: false); 386 | if (excludeHidden == true) { 387 | for (var fileOrDir in contents) { 388 | if (fileOrDir is Directory) { 389 | if (!fileOrDir.path.startsWith(".")) 390 | directories 391 | .add(Directory(pathlib.normalize(fileOrDir.absolute.path))); 392 | } 393 | } 394 | } else { 395 | for (var fileOrDir in contents) { 396 | if (fileOrDir is Directory) { 397 | // dir/../dir3 to dir/dir2/dir3 398 | directories 399 | .add(Directory(pathlib.normalize(fileOrDir.absolute.path))); 400 | } 401 | } 402 | } 403 | } catch (error) { 404 | throw FileManagerError(permissionMessage + error.toString()); 405 | } 406 | if (directories != null) { 407 | return sortBy(directories, sortedBy); 408 | } 409 | 410 | return directories; 411 | } 412 | 413 | /// e.g: 414 | Future deleteAll(List files) async { 415 | try { 416 | for (var file in files) { 417 | file.delete(); 418 | } 419 | } on FileSystemException catch (e) { 420 | throw FileManagerError(e.toString()); 421 | } catch (e) { 422 | rethrow; 423 | } 424 | } 425 | 426 | /// Delete a directory recursively or not 427 | /// 428 | /// e.g: 429 | /// * deleteFile(/storage/emulated/0/myFile.txt") 430 | bool deleteDir(String path, {recursive: false}) { 431 | //print("~ deleting:" + path); 432 | if (File(path).existsSync()) { 433 | throw Exception("This is a file path not a directory path"); 434 | } 435 | var file = File(path); 436 | try { 437 | file.delete(recursive: recursive); 438 | return true; 439 | } catch (error) { 440 | throw FileManagerError(error.toString()); 441 | } 442 | } 443 | -------------------------------------------------------------------------------- /lib/src/filter.dart: -------------------------------------------------------------------------------- 1 | // dart 2 | import 'dart:io'; 3 | 4 | // packages 5 | import 'package:path/path.dart' as pathlib; 6 | 7 | // local 8 | import 'file_system_utils.dart'; 9 | import 'exceptions.dart'; 10 | 11 | // Base file filter for creating other filters 12 | abstract class FileFilter { 13 | /// Checking if file is valid or not 14 | /// if it was valid then return [true] else [false] 15 | bool isValid(String path, String root); 16 | } 17 | 18 | class SimpleFileFilter extends FileFilter { 19 | /// Allowed allowedExtensions 20 | /// 21 | /// There must not be . before extension name 22 | List allowedExtensions; 23 | 24 | /// If [true] (default) then get hidden, 25 | /// else [false] do not get hidden 26 | bool includeHidden; 27 | 28 | /// Only return [File]s 29 | bool fileOnly; 30 | 31 | /// Only return [Directory]s 32 | bool directoryOnly; 33 | SimpleFileFilter( 34 | {this.allowedExtensions, 35 | this.includeHidden: true, 36 | this.fileOnly: false, 37 | this.directoryOnly: false}) 38 | : assert(validExtensions(allowedExtensions)), 39 | assert(!(fileOnly && directoryOnly)); 40 | 41 | bool checkExtension(String path) { 42 | if (allowedExtensions == null) return true; 43 | return allowedExtensions 44 | .contains(pathlib.extension(path).replaceFirst('.', '')); 45 | } 46 | 47 | @override 48 | bool isValid(String path, String root) { 49 | if (directoryOnly) { 50 | // is directory or link 51 | if (FileSystemEntity.isDirectorySync(path)) { 52 | if (!includeHidden) { 53 | if (isHidden(path, root)) { 54 | return false; 55 | } 56 | return true; 57 | } 58 | return true; 59 | // is file 60 | } else 61 | return false; 62 | } else if (fileOnly) { 63 | // is directory or link 64 | if (FileSystemEntity.isDirectorySync(path)) { 65 | return false; 66 | // is file 67 | } else if (FileSystemEntity.isFileSync(path)) { 68 | if (checkExtension(path)) { 69 | if (!includeHidden) { 70 | if (isHidden(path, root)) { 71 | return false; 72 | } 73 | } 74 | 75 | return true; 76 | } 77 | return false; 78 | } else if (FileSystemEntity.isLinkSync(path)) { 79 | return true; 80 | } else { 81 | return false; 82 | } 83 | } else { 84 | // is directory or link 85 | if (path is Directory) { 86 | if (!includeHidden) { 87 | if (isHidden(path, root)) { 88 | return false; 89 | } 90 | return true; 91 | } 92 | return true; 93 | // is file 94 | } else if (path is File) { 95 | if (checkExtension(path)) { 96 | if (!includeHidden) { 97 | if (isHidden(path, root)) { 98 | return false; 99 | } 100 | } 101 | 102 | return true; 103 | } 104 | return false; 105 | } else if (path is Link) { 106 | return true; 107 | } else { 108 | return true; 109 | } 110 | } 111 | } 112 | 113 | static bool validExtensions(List extensions) { 114 | if (extensions != null) { 115 | for (var extension in extensions) { 116 | if (extension.startsWith('.')) { 117 | throw NotValidExtensionError(extension); 118 | } 119 | } 120 | return true; 121 | } 122 | return true; 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /lib/src/io_extensions.dart: -------------------------------------------------------------------------------- 1 | /* 2 | This code is used to extend dart:io llibrary, 3 | to add extra functionality to avoid repeating code 4 | */ 5 | 6 | // dart 7 | import 'dart:io'; 8 | 9 | // packages 10 | import 'package:path/path.dart' as pathlib; 11 | 12 | /// Extension on [File] 13 | extension ExtendedFile on File { 14 | /// Get the extension of a file 15 | String extension() { 16 | return pathlib.extension(path); 17 | } 18 | 19 | String basename() { 20 | return pathlib.basename(path); 21 | } 22 | } 23 | 24 | /// Extension on [Directory] 25 | extension ExtendedDirectory on Directory { 26 | String basename() { 27 | return pathlib.basename(this.path); 28 | } 29 | } 30 | 31 | /// Extension on [FileSystemEntity] 32 | extension ExtendedFileSystemEntity on FileSystemEntity { 33 | String basename() { 34 | return pathlib.basename(path); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/sorting.dart: -------------------------------------------------------------------------------- 1 | enum FlutterFileUtilsSorting { Date, Size, Type, Alpha } 2 | -------------------------------------------------------------------------------- /lib/src/storage_utils.dart: -------------------------------------------------------------------------------- 1 | // dart sdk 2 | import 'dart:io'; 3 | 4 | // packages 5 | import 'package:package_info/package_info.dart'; 6 | import 'package:path_provider/path_provider.dart'; 7 | import 'package:path/path.dart' as pathlib; 8 | 9 | /// Return all **paths** 10 | Future> getStorageList() async { 11 | List paths = await getExternalStorageDirectories(); 12 | List filteredPaths = List(); 13 | for (Directory dir in paths) { 14 | filteredPaths 15 | .add(await getExternalStorageWithoutDataDir(dir.absolute.path)); 16 | } 17 | return filteredPaths; 18 | } 19 | 20 | /// This function aims to get path like: `/storage/emulated/0/` 21 | /// not like `/storage/emulated/0/Android/data/package.name.example/files` 22 | Future getExternalStorageWithoutDataDir( 23 | String unfilteredPath) async { 24 | PackageInfo packageInfo = await PackageInfo.fromPlatform(); 25 | print("storage_helper->getExternalStorageWithoutDataDir: " + 26 | packageInfo.packageName); 27 | String subPath = 28 | pathlib.join("Android", "data", packageInfo.packageName, "files"); 29 | if (unfilteredPath.contains(subPath)) { 30 | String filteredPath = unfilteredPath.split(subPath).first; 31 | print("storage_helper->getExternalStorageWithoutDataDir: " + filteredPath); 32 | return Directory(filteredPath); 33 | } else { 34 | return Directory(unfilteredPath); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /lib/src/time_tools.dart: -------------------------------------------------------------------------------- 1 | class TimeTools { 2 | static String timeNormalize(DateTime dateTime) { 3 | return dateTime.toUtc().toString().split(".")[0]; 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /lib/utils.dart: -------------------------------------------------------------------------------- 1 | export 'src/storage_utils.dart'; 2 | export 'src/file_system_utils.dart'; 3 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.4.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.3" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | image: 71 | dependency: transitive 72 | description: 73 | name: image 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "2.1.4" 77 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "0.12.6" 84 | meta: 85 | dependency: transitive 86 | description: 87 | name: meta 88 | url: "https://pub.dartlang.org" 89 | source: hosted 90 | version: "1.1.8" 91 | package_info: 92 | dependency: "direct main" 93 | description: 94 | name: package_info 95 | url: "https://pub.dartlang.org" 96 | source: hosted 97 | version: "0.4.0+13" 98 | path: 99 | dependency: "direct main" 100 | description: 101 | name: path 102 | url: "https://pub.dartlang.org" 103 | source: hosted 104 | version: "1.6.4" 105 | path_provider: 106 | dependency: "direct main" 107 | description: 108 | name: path_provider 109 | url: "https://pub.dartlang.org" 110 | source: hosted 111 | version: "1.5.1" 112 | pedantic: 113 | dependency: transitive 114 | description: 115 | name: pedantic 116 | url: "https://pub.dartlang.org" 117 | source: hosted 118 | version: "1.8.0+1" 119 | petitparser: 120 | dependency: transitive 121 | description: 122 | name: petitparser 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "2.4.0" 126 | platform: 127 | dependency: transitive 128 | description: 129 | name: platform 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "2.2.1" 133 | quiver: 134 | dependency: transitive 135 | description: 136 | name: quiver 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "2.0.5" 140 | sky_engine: 141 | dependency: transitive 142 | description: flutter 143 | source: sdk 144 | version: "0.0.99" 145 | source_span: 146 | dependency: transitive 147 | description: 148 | name: source_span 149 | url: "https://pub.dartlang.org" 150 | source: hosted 151 | version: "1.5.5" 152 | stack_trace: 153 | dependency: transitive 154 | description: 155 | name: stack_trace 156 | url: "https://pub.dartlang.org" 157 | source: hosted 158 | version: "1.9.3" 159 | stream_channel: 160 | dependency: transitive 161 | description: 162 | name: stream_channel 163 | url: "https://pub.dartlang.org" 164 | source: hosted 165 | version: "2.0.0" 166 | string_scanner: 167 | dependency: transitive 168 | description: 169 | name: string_scanner 170 | url: "https://pub.dartlang.org" 171 | source: hosted 172 | version: "1.0.5" 173 | term_glyph: 174 | dependency: transitive 175 | description: 176 | name: term_glyph 177 | url: "https://pub.dartlang.org" 178 | source: hosted 179 | version: "1.1.0" 180 | test_api: 181 | dependency: transitive 182 | description: 183 | name: test_api 184 | url: "https://pub.dartlang.org" 185 | source: hosted 186 | version: "0.2.11" 187 | typed_data: 188 | dependency: transitive 189 | description: 190 | name: typed_data 191 | url: "https://pub.dartlang.org" 192 | source: hosted 193 | version: "1.1.6" 194 | vector_math: 195 | dependency: transitive 196 | description: 197 | name: vector_math 198 | url: "https://pub.dartlang.org" 199 | source: hosted 200 | version: "2.0.8" 201 | xml: 202 | dependency: transitive 203 | description: 204 | name: xml 205 | url: "https://pub.dartlang.org" 206 | source: hosted 207 | version: "3.5.0" 208 | sdks: 209 | dart: ">=2.6.0 <3.0.0" 210 | flutter: ">=1.10.0 <2.0.0" 211 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_file_utils 2 | description: Helper tools for managing files on Android 3 | version: 0.2.0 4 | author: Mohamed Naga 5 | homepage: https://github.com/nagakm/flutter_file_utils 6 | 7 | environment: 8 | sdk: ">=2.6.0 <3.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | path: ">=1.5.1 <3.0.0" 14 | path_provider: ">=1.5.1 <3.0.0" 15 | package_info: ">=0.4.0 <3.0.0" 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | # For information on the generic Dart part of this file, see the 22 | # following page: https://www.dartlang.org/tools/pub/pubspec 23 | 24 | # The following section is specific to Flutter. 25 | flutter: 26 | # To add assets to your package, add an assets section, like this: 27 | # assets: 28 | # - images/a_dot_burr.jpeg 29 | # - images/a_dot_ham.jpeg 30 | # 31 | # For details regarding assets in packages, see 32 | # https://flutter.io/assets-and-images/#from-packages 33 | # 34 | # An image asset can refer to one or more resolution-specific "variants", see 35 | # https://flutter.io/assets-and-images/#resolution-aware. 36 | # To add custom fonts to your package, add a fonts section here, 37 | # in this "flutter" section. Each entry in this list should have a 38 | # "family" key with the font family name, and a "fonts" key with a 39 | # list giving the asset and other descriptors for the font. For 40 | # example: 41 | # fonts: 42 | # - family: Schyler 43 | # fonts: 44 | # - asset: fonts/Schyler-Regular.ttf 45 | # - asset: fonts/Schyler-Italic.ttf 46 | # style: italic 47 | # - family: Trajan Pro 48 | # fonts: 49 | # - asset: fonts/TrajanPro.ttf 50 | # - asset: fonts/TrajanPro_Bold.ttf 51 | # weight: 700 52 | # 53 | # For details regarding fonts in packages, see 54 | # https://flutter.io/custom-fonts/#from-packages 55 | -------------------------------------------------------------------------------- /screenshots/details.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/screenshots/details.jpg -------------------------------------------------------------------------------- /screenshots/filtering_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/screenshots/filtering_example.png -------------------------------------------------------------------------------- /screenshots/permission.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MohamSayed/flutter_file_utils/29d01235308fc9bc164ad57d186904973ba05cfd/screenshots/permission.jpg --------------------------------------------------------------------------------