Showing
1 changed file
with
4 additions
and
0 deletions
| @@ -192,6 +192,10 @@ class MethodChannelMobileScanner extends MobileScannerPlatform { | @@ -192,6 +192,10 @@ class MethodChannelMobileScanner extends MobileScannerPlatform { | ||
| 192 | 192 | ||
| 193 | @override | 193 | @override |
| 194 | Future<void> setTorchState(TorchState torchState) async { | 194 | Future<void> setTorchState(TorchState torchState) async { |
| 195 | + if (torchState == TorchState.unavailable) { | ||
| 196 | + return; | ||
| 197 | + } | ||
| 198 | + | ||
| 195 | await methodChannel.invokeMethod<void>('torch', torchState.rawValue); | 199 | await methodChannel.invokeMethod<void>('torch', torchState.rawValue); |
| 196 | } | 200 | } |
| 197 | 201 |
-
Please register or login to post a comment