From fc640eade09a5d8720f4be45e84175bdefc8c423 Mon Sep 17 00:00:00 2001 From: r4khul Date: Wed, 4 Feb 2026 20:24:10 +0530 Subject: [PATCH] Remove torchState variable in ValueListenableBuilder --- lib/qr_code_screen.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/qr_code_screen.dart b/lib/qr_code_screen.dart index 8dc8f49..05f9295 100644 --- a/lib/qr_code_screen.dart +++ b/lib/qr_code_screen.dart @@ -48,14 +48,13 @@ class _QrCodeScreenState extends State { ValueListenableBuilder( valueListenable: _controller, builder: (context, state, _) { - final torchState = state.torchState; return IconButton( icon: Icon( - torchState == TorchState.on + state.torchState == TorchState.on ? Icons.flash_on : Icons.flash_off, ), - onPressed: torchState == TorchState.unavailable + onPressed: state.torchState == TorchState.unavailable ? null : () => _controller.toggleTorch(), );