Skip to content

Commit ebecf1e

Browse files
authored
Merge pull request #6 from 4-alok/main
Updated ReadMe
2 parents 962ffa2 + e28b895 commit ebecf1e

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,32 @@ Make sure to check out [examples](https://github.com/DevsOnFlutter/file_manager/
1010

1111
### Installation
1212

13+
Give storage permission to application
14+
15+
Beside needing to add WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE to your android/app/src/main/AndroidManifest.xml
16+
17+
```xml
18+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
19+
package="com.xxx.yyy">
20+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
21+
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
22+
23+
<application
24+
android:requestLegacyExternalStorage="true"
25+
...
26+
...
27+
</manifest>
28+
```
29+
also add f0r Android 10
30+
```
31+
<application
32+
android:requestLegacyExternalStorage="true"
33+
...
34+
```
35+
36+
**You also need Runtime Request Permission**
37+
allow storage permission from app setting manually or you may use any package such as [`permission_handler`](https://pub.dev/packages/permission_handler).
38+
1339
Add the following line to `pubspec.yaml`:
1440

1541
```yaml
@@ -85,10 +111,7 @@ FileManager(
85111
|--------------|-----------------|
86112
| `isFile` | check weather FileSystemEntity is File. |
87113
| `isDirectory` | check weather FileSystemEntity is Directory. |
88-
| `basename` | Get the basename of Directory or File. Provide `File`, `Directory` or `FileSystemEntity` and returns the name as a `String`. ie
89-
```dart
90-
controller.dirName(dir);
91-
```
114+
| `basename` | Get the basename of Directory or File. Provide `File`, `Directory` or `FileSystemEntity` and returns the name as a `String`. If you want to hide the extension of a file, you may use optional parameter `showFileExtension`. ie ```controller.dirName(dir, true)```
92115
|
93116
| `formatBytes` | Convert bytes to human readable size.[getCurrentDirectory]. |
94117
| `setCurrentPath` | Set current directory path by providing `String` of path, similar to [openDirectory]. `List<FileSystemEntity>.` |

lib/file_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ bool isDirectory(FileSystemEntity entity) {
114114
///
115115
/// ie:
116116
/// ```dart
117-
/// controller.dirName(dir);
117+
/// controller.basename(dir);
118118
/// ```
119119
/// to hide the extension of file, showFileExtension = flase
120120
String basename(dynamic entity, [bool showFileExtension = true]) {

0 commit comments

Comments
 (0)