Navaron Bracke

use a sized box instead of an error

@@ -179,13 +179,7 @@ class MethodChannelMobileScanner extends MobileScannerPlatform { @@ -179,13 +179,7 @@ class MethodChannelMobileScanner extends MobileScannerPlatform {
179 @override 179 @override
180 Widget buildCameraView() { 180 Widget buildCameraView() {
181 if (_textureId == null) { 181 if (_textureId == null) {
182 - throw const MobileScannerException(  
183 - errorCode: MobileScannerErrorCode.controllerUninitialized,  
184 - errorDetails: MobileScannerErrorDetails(  
185 - message:  
186 - 'The controller was not yet initialized. Call start() before calling buildCameraView().',  
187 - ),  
188 - ); 182 + return const SizedBox();
189 } 183 }
190 184
191 return Texture(textureId: _textureId!); 185 return Texture(textureId: _textureId!);
@@ -69,13 +69,7 @@ class MobileScannerWeb extends MobileScannerPlatform { @@ -69,13 +69,7 @@ class MobileScannerWeb extends MobileScannerPlatform {
69 @override 69 @override
70 Widget buildCameraView() { 70 Widget buildCameraView() {
71 if (!_barcodeReader.isScanning) { 71 if (!_barcodeReader.isScanning) {
72 - throw const MobileScannerException(  
73 - errorCode: MobileScannerErrorCode.controllerUninitialized,  
74 - errorDetails: MobileScannerErrorDetails(  
75 - message:  
76 - 'The controller was not yet initialized. Call start() before calling buildCameraView().',  
77 - ),  
78 - ); 72 + return const SizedBox();
79 } 73 }
80 74
81 return HtmlElementView(viewType: _viewType); 75 return HtmlElementView(viewType: _viewType);