Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Nghia | b0333b0d9c |
|
@ -30,14 +30,13 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {
|
|||
|
||||
Stream<ReminderState> _mapInitialEventToState() async* {
|
||||
yield state.update(isLoading: true);
|
||||
reminders = await remindersUseCase.getFull();
|
||||
yield state.update(list: reminders,isLoading: false);
|
||||
List<ReminderEntity> check = await remindersUseCase.getFull();
|
||||
yield state.update(list: check,isLoading: false);
|
||||
}
|
||||
|
||||
Stream<ReminderState> _mapAddTitleEventToState(AddTitleEvent event) async* {
|
||||
yield state.update(isLoading: true);
|
||||
ReminderEntity reminderEntity = ReminderEntity(title: event.title);
|
||||
reminders.add(reminderEntity);
|
||||
await remindersUseCase.addNote(reminderEntity);
|
||||
yield state.update(list: reminders,isLoading:false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue