Browse Source

Fix 0 size

camera_next
Vitaliy Zarubin 1 year ago
parent
commit
88a3ff7558
  1. 3
      packages/camera/camera_aurora/lib/camera_aurora.dart
  2. 5
      packages/camera/camera_aurora/lib/camera_viewfinder.dart

3
packages/camera/camera_aurora/lib/camera_aurora.dart

@ -87,6 +87,9 @@ class CameraAurora extends CameraPlatform {
BuildContext context,
BoxConstraints constraints,
) {
if (constraints.maxWidth.isNaN || constraints.maxHeight.isNaN) {
return const SizedBox.shrink();
}
CameraAuroraPlatform.instance
.resizeFrame(constraints.maxWidth, constraints.maxHeight);
return CameraViewfinder(

5
packages/camera/camera_aurora/lib/camera_viewfinder.dart

@ -52,8 +52,11 @@ class _CameraViewfinderState extends State<CameraViewfinder> {
),
);
} else if (_cameraState.isNotEmpty()) {
int turn = 0;
if (_cameraState.width == 0 || _cameraState.height == 0) {
return const SizedBox.shrink();
}
int turn = 0;
bool isFront = _cameraState.id.contains('front');
switch (_cameraState.mountAngle) {

Loading…
Cancel
Save