Skip to content

Commit 1b396d3

Browse files
committed
refactor: resolve commit error
1 parent 1ea1117 commit 1b396d3

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

lib/presentation/alarm/bloc/alarm_timer/alarm_timer_bloc.dart

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
111111
add(const AlarmTimerStepNextShifted());
112112
}
113113
}
114-
114+
115115
// 타이머 시작 메서드
116116
void _startTicker(int duration, Emitter<AlarmTimerState> emit) {
117117
_tickerSubscription?.cancel();
@@ -136,6 +136,7 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
136136
final updatedIsLate = updatedBeforeOutTime <= 0;
137137

138138
if (newRemaining >= 0) {
139+
print("타이머 tick: $newRemaining초 남음");
139140
add(AlarmTimerStepTicked(
140141
preparationRemainingTime: newRemaining,
141142
preparationElapsedTime: elapsed,
@@ -144,9 +145,9 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
144145
isLate: updatedIsLate,
145146
));
146147
} else {
148+
print("타이머 완료됨");
147149
add(const AlarmTimerStepNextShifted());
148150
}
149-
150151
});
151152
}
152153

@@ -242,33 +243,6 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
242243
return super.close();
243244
}
244245

245-
void _onPreparationsTimeOvered(
246-
AlarmTimerPreparationsTimeOvered event,
247-
Emitter<AlarmTimerState> emit,
248-
) {
249-
final updatedStates =
250-
List<PreparationStateEnum>.from(state.preparationStepStates);
251-
updatedStates[state.currentStepIndex] = PreparationStateEnum.done;
252-
253-
emit(AlarmTimerPreparationsTimeOver(
254-
preparationSteps: state.preparationSteps,
255-
currentStepIndex: state.currentStepIndex,
256-
stepElapsedTimes: state.stepElapsedTimes,
257-
preparationStepStates: updatedStates,
258-
preparationRemainingTime: 0,
259-
totalRemainingTime: 0,
260-
totalPreparationTime: state.totalPreparationTime,
261-
progress: 1.0,
262-
beforeOutTime: state.beforeOutTime,
263-
isLate: state.isLate,
264-
));
265-
266-
@override
267-
Future<void> close() {
268-
_tickerSubscription?.cancel();
269-
return super.close();
270-
}
271-
272246
void _onPreparationsTimeOvered(
273247
AlarmTimerPreparationsTimeOvered event,
274248
Emitter<AlarmTimerState> emit,
@@ -305,4 +279,3 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
305279
});
306280
}
307281
}
308-

0 commit comments

Comments
 (0)