manageStoragePermissions function

Future<void> manageStoragePermissions({
  1. required FutureOr<void>? onGrantedCallback(),
  2. required FutureOr<void>? onDeniedCallback(),
  3. 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();
}