toggleFlashMode method

Future<void> toggleFlashMode()

Implementation

Future<void> toggleFlashMode() async {
  await _safeCall(
    callback: () async {
      final mode = _cameraController!.value.flashMode == FlashMode.off ? FlashMode.torch : FlashMode.off;
      value = value.copyWith(flashMode: mode);
      await _cameraController!.setFlashMode(mode);
    },
    customException: CameraExceptions.flaseMode,
  );
}