Showing
1 changed file
with
3 additions
and
0 deletions
| @@ -225,6 +225,9 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> { | @@ -225,6 +225,9 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> { | ||
| 225 | cameraDirection: effectiveDirection, | 225 | cameraDirection: effectiveDirection, |
| 226 | isInitialized: true, | 226 | isInitialized: true, |
| 227 | size: viewAttributes.size, | 227 | size: viewAttributes.size, |
| 228 | + // If the device has a flashlight, let the platform update the torch state. | ||
| 229 | + // If it does not have one, provide the unavailable state directly. | ||
| 230 | + torchState: viewAttributes.hasTorch ? null : TorchState.unavailable, | ||
| 228 | ); | 231 | ); |
| 229 | } on MobileScannerException catch (error) { | 232 | } on MobileScannerException catch (error) { |
| 230 | if (!_isDisposed) { | 233 | if (!_isDisposed) { |
-
Please register or login to post a comment