manageStoragePermissions function
Future<void>
manageStoragePermissions(
{ - required FutureOr<void>? onGrantedCallback(),
- required FutureOr<void>? onDeniedCallback(),
- required FutureOr<void>? onPermanentlyDeniedCallback(),
})
Implementation
Future<void> manageStoragePermissions({
required FutureOr<void>? Function() onGrantedCallback,
required FutureOr<void>? Function() onDeniedCallback,
required FutureOr<void>? Function() onPermanentlyDeniedCallback,
}) async {
// manage permission for camera
await Permission.storage.onDeniedCallback(() async {
// Your code
await onDeniedCallback();
}).onGrantedCallback(() async {
// Your code
await onGrantedCallback();
}).onPermanentlyDeniedCallback(() async {
// Your code
await onPermanentlyDeniedCallback();
}).onLimitedCallback(() async {
await onGrantedCallback();
}).request();
}