setFlashMode method
Sets the camera's flash mode to the specified flashMode (off, on, auto, etc.).
- If the current flash mode is already the desired one, no action is taken.
Implementation
Future<void> setFlashMode(FlashMode flashMode) async {
if (flashModeState == flashMode) {
log("flash mode same with current condition");
return;
}
await _cameraController?.setFlashMode(flashMode);
flashModeState = flashMode;
log("successfully update flashMode to $flashMode");
if (_onFlashModeChanged != null) {
_onFlashModeChanged?.call(flashMode);
}
}