/// The permission status of a camera.
enum CameraPermissionStatus {
  /// The permission is authorized by user.
  authorized,

  /// The permission is not determined.
  notDetermined,

  /// The permission is denied by user.
  denied,

  /// The permisssion is restricted by system.
  restricted
}

/// Parse the camera permission from a string value.
CameraPermissionStatus cameraPermissionFromString(String? value) {
  if (value == null) {
    return CameraPermissionStatus.denied;
  }
  switch (value) {
    case "authorized":
      return CameraPermissionStatus.authorized;
    case "not-determined":
      return CameraPermissionStatus.notDetermined;
    case "denied":
      return CameraPermissionStatus.denied;
    case "restricted":
      return CameraPermissionStatus.restricted;
    default:
      return CameraPermissionStatus.denied;
  }
}
