The bloc now uses the value from the stream to submit the new event

This commit is contained in:
Mariano Uvalle 2019-04-04 02:25:44 -06:00
parent bc51a48b6a
commit caee24297b

View file

@ -17,7 +17,6 @@ class NewTaskBloc {
String text = '';
TaskPriority priority = TaskPriority.high;
String event = '';
//Stream getters.
Observable<UserModel> get userModelStream => _user.stream;
@ -38,15 +37,11 @@ class NewTaskBloc {
priority = newPriority;
}
void setEvent(String newEvent) {
event = newEvent;
}
Future<void> submit() {
final newTask = TaskModel(
text: text,
priority: priority,
event: event,
event: _eventName.value,
ownerUsername: _user.value.username,
done: false,
);