Deleted the CurrentSelectionService and moved to route parameters

This commit is contained in:
Mariano Uvalle 2019-04-06 22:53:22 -06:00
parent b39a490384
commit dd13cebb80
9 changed files with 80 additions and 87 deletions

View file

@ -93,11 +93,12 @@ class _HomeScreenState extends State<HomeScreen> {
task: task,
onDone: () => bloc.markTaskAsDone(task),
onEventPressed: () {
bloc.updateSelectedEvent(task);
// Include the event name in the route.
Navigator.of(context).pushNamed('event/${task.event}');
},
onEditPressed: () {
bloc.updateSelectedTask(task);
Navigator.of(context).pushNamed('editTask/');
// Include the id of the task to be edited in the route.
Navigator.of(context).pushNamed('editTask/${task.id}');
},
),
padding: EdgeInsets.only(bottom: 12),