Skip to content

Commit

Permalink
## 3.1.0
Browse files Browse the repository at this point in the history
- Update provider, permission_handler
- Add manage_external_storage and photo permission
  • Loading branch information
Nialixus committed Sep 13, 2023
2 parents bf9e9fc + 311b7ac commit c5cb38f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@
## 3.1.0

- Update provider, permission_handler
- Add request photo permission
- Add manage_external_storage and photo permission
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add this to your `pubspec.yaml`.

```yaml
dependencies:
filesaverz: ^3.0.0
filesaverz: ^3.1.0
```
Continue by adding permission in your `AndroidManifest.xml`.
Expand Down
11 changes: 9 additions & 2 deletions lib/src/addons/filebrowser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,17 @@ export '../addons/filebrowser.dart' hide filebrowser;
/// Opening a custom file explorer.
Future<String?> filebrowser(BuildContext context, FileSaver fileSaver) async {
Permission storage = Permission.storage;
Permission storage2 = Permission.manageExternalStorage;
Permission photos = Permission.photos;
await storage.request();
await storage2.request();
await photos.request();
PermissionStatus permissionStatus = await storage.status;

if (permissionStatus.isGranted) {
PermissionStatus permissionStatusPhotos = await photos.status;
PermissionStatus permissionStatusStorage = await storage2.status;
if (permissionStatus.isGranted ||
permissionStatusStorage.isGranted ||
permissionStatusPhotos.isGranted) {
/// If app have permission, it will opening a custom file expolorer of [FileSaver].
return showDialog<String>(
context: context,
Expand Down

0 comments on commit c5cb38f

Please sign in to comment.