Navaron Bracke

fix documentation for auto torch mode

... ... @@ -144,8 +144,6 @@ class ToggleFlashlightButton extends StatelessWidget {
iconSize: 32.0,
icon: const Icon(Icons.flash_auto),
onPressed: () async {
// This button only turns off the auto mode.
// Perhaps we can switch between on / off / auto?
await controller.toggleTorch();
},
);
... ...
... ... @@ -2,7 +2,7 @@
enum TorchState {
/// The flashlight turns on automatically in low light conditions.
///
/// This is currently only supported on iOS.
/// This is currently only supported on iOS and MacOS.
auto(2),
/// The flashlight is off.
... ...
... ... @@ -361,6 +361,9 @@ class MobileScannerController extends ValueNotifier<MobileScannerState> {
///
/// Does nothing if the device has no torch,
/// or if the camera is not running.
///
/// If the current torch state is [TorchState.auto],
/// the torch is turned on or off depending on its actual current state.
Future<void> toggleTorch() async {
_throwIfNotInitialized();
... ...