setTorchBrightness method
Sets flashlight torch brightness level.
Implementation
Future<void> setTorchBrightness(double level) async {
_torchLevel = level.clamp(0.0, 1.0);
if (_cameraController != null && _cameraController!.value.isInitialized) {
try {
await _cameraController!.setFlashMode(
_torchLevel > 0 ? cam.FlashMode.torch : cam.FlashMode.off,
);
} catch (_) {}
}
_safeNotifyListeners();
}