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.
27 lines
952 B
Dart
27 lines
952 B
Dart
/// Represents the camera device position.
|
|
///
|
|
/// * `back`: Indicates that the device is physically located on the back of the system hardware
|
|
/// * `front`: Indicates that the device is physically located on the front of the system hardware
|
|
///
|
|
/// #### iOS only
|
|
/// * `unspecified`: Indicates that the device's position relative to the system hardware is unspecified
|
|
///
|
|
/// #### Android only
|
|
/// * `external`: The camera device is an external camera, and has no fixed facing relative to the device's screen. (Android only)
|
|
enum CameraPosition { front, back, unspecified, external }
|
|
|
|
CameraPosition cameraPositionFromString(String string) {
|
|
switch (string) {
|
|
case 'front':
|
|
return CameraPosition.front;
|
|
case 'back':
|
|
return CameraPosition.back;
|
|
case 'unspecified':
|
|
return CameraPosition.unspecified;
|
|
case 'external':
|
|
return CameraPosition.external;
|
|
default:
|
|
return CameraPosition.unspecified;
|
|
}
|
|
}
|