File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -488,10 +488,13 @@ class CameraPickerState extends State<CameraPicker>
488
488
BoxConstraints constraints,
489
489
CameraController controller,
490
490
) {
491
+ final int turns = widget.cameraQuarterTurns;
492
+ final String orientation = controller.value.deviceOrientation.toString ();
491
493
// Fetch the biggest size from the constraints.
492
494
Size size = constraints.biggest;
493
495
// Flip the size when the preview needs to turn with an odd count of quarters.
494
- if (widget.cameraQuarterTurns % 2 != 0 ) {
496
+ if ((turns.isOdd && orientation.contains ('portrait' )) ||
497
+ (turns.isEven && orientation.contains ('landscape' ))) {
495
498
size = size.flipped;
496
499
}
497
500
// Calculate scale depending on the size and camera ratios.
You can’t perform that action at this time.
0 commit comments