Work editor: Allow removing composer or instrument

This commit is contained in:
Elias Projahn 2020-03-22 14:13:42 +01:00
parent 44de5fdae3
commit 554cf4a6ac

View file

@ -55,6 +55,12 @@ class WorkProperties extends StatelessWidget {
subtitle: Text(composer != null subtitle: Text(composer != null
? '${composer.firstName} ${composer.lastName}' ? '${composer.firstName} ${composer.lastName}'
: 'Select composer'), : 'Select composer'),
trailing: IconButton(
icon: const Icon(Icons.delete),
onPressed: () {
onComposerChanged(null);
},
),
onTap: () async { onTap: () async {
final Person person = await Navigator.push( final Person person = await Navigator.push(
context, context,
@ -73,6 +79,11 @@ class WorkProperties extends StatelessWidget {
subtitle: Text(instruments.isNotEmpty subtitle: Text(instruments.isNotEmpty
? instruments.map((i) => i.name).join(', ') ? instruments.map((i) => i.name).join(', ')
: 'Select instruments'), : 'Select instruments'),
trailing: IconButton(
icon: const Icon(Icons.delete),
onPressed: () {
onInstrumentsChanged([]);
}),
onTap: () async { onTap: () async {
final List<Instrument> selection = await Navigator.push( final List<Instrument> selection = await Navigator.push(
context, context,