@@ -111,7 +111,7 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
111
111
add (const AlarmTimerStepNextShifted ());
112
112
}
113
113
}
114
-
114
+
115
115
// 타이머 시작 메서드
116
116
void _startTicker (int duration, Emitter <AlarmTimerState > emit) {
117
117
_tickerSubscription? .cancel ();
@@ -136,6 +136,7 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
136
136
final updatedIsLate = updatedBeforeOutTime <= 0 ;
137
137
138
138
if (newRemaining >= 0 ) {
139
+ print ("타이머 tick: $newRemaining 초 남음" );
139
140
add (AlarmTimerStepTicked (
140
141
preparationRemainingTime: newRemaining,
141
142
preparationElapsedTime: elapsed,
@@ -144,9 +145,9 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
144
145
isLate: updatedIsLate,
145
146
));
146
147
} else {
148
+ print ("타이머 완료됨" );
147
149
add (const AlarmTimerStepNextShifted ());
148
150
}
149
-
150
151
});
151
152
}
152
153
@@ -242,33 +243,6 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
242
243
return super .close ();
243
244
}
244
245
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
-
272
246
void _onPreparationsTimeOvered (
273
247
AlarmTimerPreparationsTimeOvered event,
274
248
Emitter <AlarmTimerState > emit,
@@ -305,4 +279,3 @@ class AlarmTimerBloc extends Bloc<AlarmTimerEvent, AlarmTimerState> {
305
279
});
306
280
}
307
281
}
308
-
0 commit comments