manageCameraPermissions function

Future<void> manageCameraPermissions({
  1. required FutureOr<void>? onGrantedCallback(),
  2. required FutureOr<void>? onDeniedCallback(),
  3. required FutureOr<void>? onPermanentlyDeniedCallback(),
})

Implementation

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