diff --git a/packages/camera/camera_aurora/lib/camera_aurora.dart b/packages/camera/camera_aurora/lib/camera_aurora.dart index 46cb664..43ec286 100644 --- a/packages/camera/camera_aurora/lib/camera_aurora.dart +++ b/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( diff --git a/packages/camera/camera_aurora/lib/camera_viewfinder.dart b/packages/camera/camera_aurora/lib/camera_viewfinder.dart index d78d72a..64692c0 100644 --- a/packages/camera/camera_aurora/lib/camera_viewfinder.dart +++ b/packages/camera/camera_aurora/lib/camera_viewfinder.dart @@ -52,8 +52,11 @@ class _CameraViewfinderState extends State { ), ); } 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) {