remove switchCamera() from the platform interface; update definiton of set torch…
… state for the platform interface
Showing
1 changed file
with
6 additions
and
12 deletions
| 1 | import 'package:flutter/widgets.dart'; | 1 | import 'package:flutter/widgets.dart'; |
| 2 | import 'package:mobile_scanner/src/enums/camera_facing.dart'; | 2 | import 'package:mobile_scanner/src/enums/camera_facing.dart'; |
| 3 | +import 'package:mobile_scanner/src/enums/torch_state.dart'; | ||
| 3 | import 'package:mobile_scanner/src/method_channel/mobile_scanner_method_channel.dart'; | 4 | import 'package:mobile_scanner/src/method_channel/mobile_scanner_method_channel.dart'; |
| 4 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; | 5 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; |
| 5 | 6 | ||
| @@ -42,6 +43,11 @@ abstract class MobileScannerPlatform extends PlatformInterface { | @@ -42,6 +43,11 @@ abstract class MobileScannerPlatform extends PlatformInterface { | ||
| 42 | throw UnimplementedError('resetZoomScale() has not been implemented.'); | 43 | throw UnimplementedError('resetZoomScale() has not been implemented.'); |
| 43 | } | 44 | } |
| 44 | 45 | ||
| 46 | + /// Set the torch state of the active camera. | ||
| 47 | + Future<void> setTorchState(TorchState torchState) { | ||
| 48 | + throw UnimplementedError('setTorchState() has not been implemented.'); | ||
| 49 | + } | ||
| 50 | + | ||
| 45 | /// Set the zoom scale of the camera. | 51 | /// Set the zoom scale of the camera. |
| 46 | /// | 52 | /// |
| 47 | /// The [zoomScale] must be between `0.0` and `1.0` (both inclusive). | 53 | /// The [zoomScale] must be between `0.0` and `1.0` (both inclusive). |
| @@ -65,18 +71,6 @@ abstract class MobileScannerPlatform extends PlatformInterface { | @@ -65,18 +71,6 @@ abstract class MobileScannerPlatform extends PlatformInterface { | ||
| 65 | throw UnimplementedError('stop() has not been implemented.'); | 71 | throw UnimplementedError('stop() has not been implemented.'); |
| 66 | } | 72 | } |
| 67 | 73 | ||
| 68 | - /// Switch between the front and back camera. | ||
| 69 | - Future<void> switchCamera() { | ||
| 70 | - throw UnimplementedError('switchCamera() has not been implemented.'); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - /// Switch the torch on or off. | ||
| 74 | - /// | ||
| 75 | - /// Does nothing if the device has no torch. | ||
| 76 | - Future<void> toggleTorch() { | ||
| 77 | - throw UnimplementedError('toggleTorch() has not been implemented.'); | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | /// Update the scan window to the given [window] rectangle. | 74 | /// Update the scan window to the given [window] rectangle. |
| 81 | /// | 75 | /// |
| 82 | /// Any barcodes that do not intersect with the given [window] will be ignored. | 76 | /// Any barcodes that do not intersect with the given [window] will be ignored. |
-
Please register or login to post a comment