p-mazhnik

fix hasTorch getter

@@ -106,13 +106,14 @@ class MobileScannerController { @@ -106,13 +106,14 @@ class MobileScannerController {
106 /// 106 ///
107 /// Throws an error if the controller is not initialized. 107 /// Throws an error if the controller is not initialized.
108 bool get hasTorch { 108 bool get hasTorch {
109 - if (_hasTorch == null) { 109 + final hasTorch = hasTorchState.value;
  110 + if (hasTorch == null) {
110 throw const MobileScannerException( 111 throw const MobileScannerException(
111 errorCode: MobileScannerErrorCode.controllerUninitialized, 112 errorCode: MobileScannerErrorCode.controllerUninitialized,
112 ); 113 );
113 } 114 }
114 115
115 - return _hasTorch!; 116 + return hasTorch;
116 } 117 }
117 118
118 /// Set the starting arguments for the camera 119 /// Set the starting arguments for the camera