Work editor: Initialize from WorkInfo

This commit is contained in:
Elias Projahn 2020-04-26 17:26:19 +02:00
parent 97c4359ad9
commit ea0f7f86aa
3 changed files with 36 additions and 77 deletions

View file

@ -16,7 +16,7 @@ class PersonScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final backend = Backend.of(context);
return Scaffold(
appBar: AppBar(
title: Text('${person.firstName} ${person.lastName}'),
@ -47,14 +47,18 @@ class PersonScreen extends StatelessWidget {
final work = snapshot.data[index];
return ListTile(
title: Text(work.title),
onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => WorkScreen(
work: work,
onTap: () async {
final workInfo = await backend.db.getWorkInfo(work);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => WorkScreen(
workInfo: workInfo,
),
),
),
),
);
},
);
},
);