setFlashMode method
Set the flash mode when taking images.
Users should call supportedFlashModes before calling this method. Not all FlashModes are supported on all devices. Some won't support any.
This should only be called after passing as a parameter to a CameraController and CameraController.initialize has been called.
Implementation
@override
Future<void> setFlashMode(FlashMode mode) async {
verifyAttached();
switch (mode) {
case FlashMode.on:
flashMode = CaptureFlashMode.on;
break;
case FlashMode.off:
flashMode = CaptureFlashMode.off;
break;
case FlashMode.auto:
flashMode = CaptureFlashMode.auto;
break;
}
}