Skip to content

Commit

Permalink
[#101] Use Camera permission as sample
Browse files Browse the repository at this point in the history
  • Loading branch information
Doan Dinh committed Oct 28, 2022
1 parent a73a368 commit b793bfc
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions .template/lib/utils/wrappers/permission_wrapper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ abstract class PermissionWrapper {
Future<bool> isCameraPermissionDenied();

Future<bool> isCameraPermissionPermanentlyDenied();

Future<bool> requestGalleryPermission();

Future<bool> isGalleryPermissionDenied();

Future<bool> isGalleryPermissionPermanentlyDenied();

Future<bool> openAppSettings();
}

@Singleton(as: PermissionWrapper)
Expand All @@ -36,26 +28,4 @@ class PermissionWrapperImpl extends PermissionWrapper {
Future<bool> isCameraPermissionPermanentlyDenied() {
return permission_handler.Permission.camera.isPermanentlyDenied;
}

@override
Future<bool> isGalleryPermissionDenied() {
return permission_handler.Permission.photos.isDenied;
}

@override
Future<bool> isGalleryPermissionPermanentlyDenied() {
return permission_handler.Permission.photos.isPermanentlyDenied;
}

@override
Future<bool> requestGalleryPermission() {
return permission_handler.Permission.photos
.request()
.then((value) => value == permission_handler.PermissionStatus.granted);
}

@override
Future<bool> openAppSettings() {
return permission_handler.openAppSettings();
}
}

0 comments on commit b793bfc

Please sign in to comment.