mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 19:17:56 +00:00
schedule for one gang and two gang and three gange
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user