From e57fe4b97ac0790fd567f05a90426770fbf58fe8 Mon Sep 17 00:00:00 2001 From: Elias Projahn Date: Sun, 26 Apr 2020 17:02:10 +0200 Subject: [PATCH] Performance editor: Allow clearing role --- mobile/lib/editors/performance.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mobile/lib/editors/performance.dart b/mobile/lib/editors/performance.dart index 4e78380..1ebd39b 100644 --- a/mobile/lib/editors/performance.dart +++ b/mobile/lib/editors/performance.dart @@ -70,6 +70,7 @@ class _PerformanceEditorState extends State { if (newPerson != null) { setState(() { person = newPerson; + ensemble = null; }); } }, @@ -89,6 +90,7 @@ class _PerformanceEditorState extends State { if (newEnsemble != null) { setState(() { ensemble = newEnsemble; + person = null; }); } }, @@ -96,6 +98,16 @@ class _PerformanceEditorState extends State { ListTile( title: Text('Role'), subtitle: Text(role?.name ?? 'Select instrument/role'), + trailing: role != null + ? IconButton( + icon: const Icon(Icons.delete), + onPressed: () { + setState(() { + role = null; + }); + }, + ) + : null, onTap: () async { final Instrument newRole = await Navigator.push( context,