-
-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add CameraPreview quarterTurns paramater #9
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo comments below, also please update documents to describe the new parameter, thanks.
lib/src/widget/camera_picker.dart
Outdated
@@ -50,6 +51,10 @@ class CameraPicker extends StatefulWidget { | |||
: DefaultCameraPickerTextDelegate()); | |||
} | |||
|
|||
/// Quarter rotate turns. | |||
/// 摄像机视图旋转次数 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
描述旋转的单位,比如45°。
@@ -81,6 +86,7 @@ class CameraPicker extends StatefulWidget { | |||
bool isOnlyAllowRecording = false, | |||
Duration maximumRecordingDuration = const Duration(seconds: 15), | |||
ThemeData theme, | |||
int cameraQuarterTurns = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用同样的参数名
lib/src/widget/camera_picker.dart
Outdated
@@ -50,6 +51,10 @@ class CameraPicker extends StatefulWidget { | |||
: DefaultCameraPickerTextDelegate()); | |||
} | |||
|
|||
/// Quarter rotate turns. | |||
/// 摄像机视图旋转次数 | |||
final int quarterTurns; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotateQuarterTurns?
lib/src/widget/camera_picker.dart
Outdated
@@ -99,6 +105,7 @@ class CameraPicker extends StatefulWidget { | |||
isAllowRecording: isAllowRecording, | |||
isOnlyAllowRecording: isOnlyAllowRecording, | |||
theme: theme, | |||
quarterTurns: cameraQuarterTurns, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
lib/src/widget/camera_picker.dart
Outdated
@@ -533,8 +540,7 @@ class CameraPickerState extends State<CameraPicker> { | |||
children: <Widget>[ | |||
const Spacer(), | |||
// TODO(Alex): There's an issue tracking NPE of the camera plugin, so switching is temporary disabled . | |||
if ((cameras?.length ?? 0) > 1) | |||
switchCamerasButton, | |||
if ((cameras?.length ?? 0) > 1) switchCamerasButton, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
处理下格式化
增加了一个参数来控制相机视图旋转,用于在横屏下正常使用。