Add generated configuration files for Flutter integration across platforms

This commit is contained in:
mohammad
2025-06-25 15:58:58 +03:00
parent f38ac58442
commit 3c9494963d

View File

@ -16,7 +16,6 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
final ControlDeviceService controlDeviceService; final ControlDeviceService controlDeviceService;
final BatchControlDevicesService batchControlDevicesService; final BatchControlDevicesService batchControlDevicesService;
Timer? _countdownTimer; Timer? _countdownTimer;
bool _isBlocClosed = false;
AcBloc({ AcBloc({
required this.deviceId, required this.deviceId,
@ -93,7 +92,7 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
AcStatusModel.fromJson(usersMap['productUuid'], statusList); AcStatusModel.fromJson(usersMap['productUuid'], statusList);
print('Device status updated: ${deviceStatus.acSwitch}'); print('Device status updated: ${deviceStatus.acSwitch}');
if (!_isBlocClosed) { if (!isClosed) {
add(AcStatusUpdated(deviceStatus)); add(AcStatusUpdated(deviceStatus));
} }
}); });
@ -301,7 +300,7 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
totalSeconds--; totalSeconds--;
scheduledHours = totalSeconds ~/ 3600; scheduledHours = totalSeconds ~/ 3600;
scheduledMinutes = (totalSeconds % 3600) ~/ 60; scheduledMinutes = (totalSeconds % 3600) ~/ 60;
if (!_isBlocClosed) { if (!isClosed) {
add(UpdateTimerEvent()); add(UpdateTimerEvent());
} }
} else { } else {
@ -309,7 +308,7 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
timerActive = false; timerActive = false;
scheduledHours = 0; scheduledHours = 0;
scheduledMinutes = 0; scheduledMinutes = 0;
if (!_isBlocClosed) { if (!isClosed) {
add(TimerCompletedEvent()); add(TimerCompletedEvent());
} }
} }
@ -338,7 +337,7 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
_startCountdownTimer( _startCountdownTimer(
emit, emit,
); );
if (!_isBlocClosed) { if (!isClosed) {
add(UpdateTimerEvent()); add(UpdateTimerEvent());
} }
} }
@ -386,7 +385,6 @@ class AcBloc extends Bloc<AcsEvent, AcsState> {
add(OnClose()); add(OnClose());
_countdownTimer?.cancel(); _countdownTimer?.cancel();
_deviceStatusSubscription?.cancel(); _deviceStatusSubscription?.cancel();
_isBlocClosed = true;
return super.close(); return super.close();
} }
} }