demo hive
This commit is contained in:
parent
a59b2830c2
commit
b0333b0d9c
|
@ -30,14 +30,13 @@ class ReminderBloc extends Bloc<ReminderEvent, ReminderState> {
|
||||||
|
|
||||||
Stream<ReminderState> _mapInitialEventToState() async* {
|
Stream<ReminderState> _mapInitialEventToState() async* {
|
||||||
yield state.update(isLoading: true);
|
yield state.update(isLoading: true);
|
||||||
reminders = await remindersUseCase.getFull();
|
List<ReminderEntity> check = await remindersUseCase.getFull();
|
||||||
yield state.update(list: reminders,isLoading: false);
|
yield state.update(list: check,isLoading: false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Stream<ReminderState> _mapAddTitleEventToState(AddTitleEvent event) async* {
|
Stream<ReminderState> _mapAddTitleEventToState(AddTitleEvent event) async* {
|
||||||
yield state.update(isLoading: true);
|
yield state.update(isLoading: true);
|
||||||
ReminderEntity reminderEntity = ReminderEntity(title: event.title);
|
ReminderEntity reminderEntity = ReminderEntity(title: event.title);
|
||||||
reminders.add(reminderEntity);
|
|
||||||
await remindersUseCase.addNote(reminderEntity);
|
await remindersUseCase.addNote(reminderEntity);
|
||||||
yield state.update(list: reminders,isLoading:false);
|
yield state.update(list: reminders,isLoading:false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue