Skip to content
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

Merged
merged 3 commits into from
Sep 22, 2020

Conversation

mjl0602
Copy link
Contributor

@mjl0602 mjl0602 commented Sep 22, 2020

增加了一个参数来控制相机视图旋转,用于在横屏下正常使用。

Copy link
Member

@AlexV525 AlexV525 left a 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.

@@ -50,6 +51,10 @@ class CameraPicker extends StatefulWidget {
: DefaultCameraPickerTextDelegate());
}

/// Quarter rotate turns.
/// 摄像机视图旋转次数
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用同样的参数名

@@ -50,6 +51,10 @@ class CameraPicker extends StatefulWidget {
: DefaultCameraPickerTextDelegate());
}

/// Quarter rotate turns.
/// 摄像机视图旋转次数
final int quarterTurns;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rotateQuarterTurns?

@@ -99,6 +105,7 @@ class CameraPicker extends StatefulWidget {
isAllowRecording: isAllowRecording,
isOnlyAllowRecording: isOnlyAllowRecording,
theme: theme,
quarterTurns: cameraQuarterTurns,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@@ -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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

处理下格式化

@AlexV525 AlexV525 merged commit 29b8cc4 into fluttercandies:master Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants