You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
854 B
Dart
34 lines
854 B
Dart
/// 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;
|
|
}
|
|
}
|