From 3c9494963d60a12767f559d84629fc6eee356079 Mon Sep 17 00:00:00 2001 From: mohammad Date: Wed, 25 Jun 2025 15:58:58 +0300 Subject: [PATCH] Add generated configuration files for Flutter integration across platforms --- lib/pages/device_managment/ac/bloc/ac_bloc.dart | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/pages/device_managment/ac/bloc/ac_bloc.dart b/lib/pages/device_managment/ac/bloc/ac_bloc.dart index eaababe1..38d11a46 100644 --- a/lib/pages/device_managment/ac/bloc/ac_bloc.dart +++ b/lib/pages/device_managment/ac/bloc/ac_bloc.dart @@ -16,7 +16,6 @@ class AcBloc extends Bloc { final ControlDeviceService controlDeviceService; final BatchControlDevicesService batchControlDevicesService; Timer? _countdownTimer; - bool _isBlocClosed = false; AcBloc({ required this.deviceId, @@ -93,7 +92,7 @@ class AcBloc extends Bloc { AcStatusModel.fromJson(usersMap['productUuid'], statusList); print('Device status updated: ${deviceStatus.acSwitch}'); - if (!_isBlocClosed) { + if (!isClosed) { add(AcStatusUpdated(deviceStatus)); } }); @@ -301,7 +300,7 @@ class AcBloc extends Bloc { totalSeconds--; scheduledHours = totalSeconds ~/ 3600; scheduledMinutes = (totalSeconds % 3600) ~/ 60; - if (!_isBlocClosed) { + if (!isClosed) { add(UpdateTimerEvent()); } } else { @@ -309,7 +308,7 @@ class AcBloc extends Bloc { timerActive = false; scheduledHours = 0; scheduledMinutes = 0; - if (!_isBlocClosed) { + if (!isClosed) { add(TimerCompletedEvent()); } } @@ -338,7 +337,7 @@ class AcBloc extends Bloc { _startCountdownTimer( emit, ); - if (!_isBlocClosed) { + if (!isClosed) { add(UpdateTimerEvent()); } } @@ -386,7 +385,6 @@ class AcBloc extends Bloc { add(OnClose()); _countdownTimer?.cancel(); _deviceStatusSubscription?.cancel(); - _isBlocClosed = true; return super.close(); } }