schedule for one gang and two gang and three gange

This commit is contained in:
mohammad
2024-09-18 13:19:43 +03:00
parent 740ca4e4ba
commit b7f59902cd
6 changed files with 1 additions and 23 deletions
@@ -242,7 +242,6 @@ class OneGangBloc extends Bloc<OneGangEvent, OneGangState> {
}
int? getTimeStampWithoutSeconds(DateTime? dateTime) {
print(dateTime);
if (dateTime == null) return null;
DateTime dateTimeWithoutSeconds = DateTime(dateTime.year, dateTime.month,
dateTime.day, dateTime.hour, dateTime.minute);
@@ -265,7 +264,6 @@ class OneGangBloc extends Bloc<OneGangEvent, OneGangState> {
} on DioException catch (e) {
final errorData = e.response!.data;
String errorMessage = errorData['message'];
// debugPrint('errorMessage=${errorMessage}');
emit(FailedState(error: errorMessage.toString()));
}
}
@@ -472,9 +472,6 @@ class ThreeGangBloc extends Bloc<ThreeGangEvent, ThreeGangState> {
void _onClose(OnClose event, Emitter<ThreeGangState> emit) {
_timer?.cancel();
// _firstSwitchTimer?.cancel();
// _secondSwitchTimer?.cancel();
// _thirdSwitchTimer?.cancel();
}
void _onStartTimer(int seconds) {
@@ -562,7 +559,6 @@ class ThreeGangBloc extends Bloc<ThreeGangEvent, ThreeGangState> {
}
int? getTimeStampWithoutSeconds(DateTime? dateTime) {
print(dateTime);
if (dateTime == null) return null;
DateTime dateTimeWithoutSeconds = DateTime(dateTime.year, dateTime.month,
dateTime.day, dateTime.hour, dateTime.minute);
@@ -585,7 +581,6 @@ class ThreeGangBloc extends Bloc<ThreeGangEvent, ThreeGangState> {
} on DioException catch (e) {
final errorData = e.response!.data;
String errorMessage = errorData['message'];
// debugPrint('errorMessage=${errorMessage}');
emit(FailedState(error: errorMessage.toString()));
}
}
@@ -420,9 +420,6 @@ class TwoGangBloc extends Bloc<TwoGangEvent, TwoGangState> {
void _onClose(OnClose event, Emitter<TwoGangState> emit) {
_timer?.cancel();
// _firstSwitchTimer?.cancel();
// _secondSwitchTimer?.cancel();
// _thirdSwitchTimer?.cancel();
}
void _onStartTimer(int seconds) {
@@ -506,7 +503,6 @@ class TwoGangBloc extends Bloc<TwoGangEvent, TwoGangState> {
}
int? getTimeStampWithoutSeconds(DateTime? dateTime) {
print(dateTime);
if (dateTime == null) return null;
DateTime dateTimeWithoutSeconds = DateTime(dateTime.year, dateTime.month,
dateTime.day, dateTime.hour, dateTime.minute);
@@ -531,7 +527,6 @@ class TwoGangBloc extends Bloc<TwoGangEvent, TwoGangState> {
} on DioException catch (e) {
final errorData = e.response!.data;
String errorMessage = errorData['message'];
// debugPrint('errorMessage=${errorMessage}');
emit(FailedState(error: errorMessage.toString()));
}
}
@@ -545,7 +540,6 @@ class TwoGangBloc extends Bloc<TwoGangEvent, TwoGangState> {
deviceUuid: twoGangId, );
if (response == true) {
add(GetScheduleEvent());
// toggleSchedule = event.id;
return toggleSchedule;
}
emit(IsToggleState(onOff: toggleSchedule));
@@ -553,7 +547,6 @@ class TwoGangBloc extends Bloc<TwoGangEvent, TwoGangState> {
} on DioException catch (e) {
final errorData = e.response!.data;
String errorMessage = errorData['message'];
print('errorMessage=${errorMessage}');
emit(FailedState(error: errorMessage.toString()));
}
}