diff --git a/lib/selectors/performer.dart b/lib/selectors/performer.dart index 86cec2f..b1c3215 100644 --- a/lib/selectors/performer.dart +++ b/lib/selectors/performer.dart @@ -14,6 +14,7 @@ class PerformerSelector extends StatefulWidget { class _PerformerSelectorState extends State { Role role; + Person person; @override Widget build(BuildContext context) { @@ -22,6 +23,18 @@ class _PerformerSelectorState extends State { return Scaffold( appBar: AppBar( title: Text('Select performer'), + actions: [ + FlatButton( + child: Text('DONE'), + onPressed: () => Navigator.pop( + context, + PerformanceModel( + person: person, + role: role, + ), + ), + ), + ], ), body: Column( children: [ @@ -65,13 +78,17 @@ class _PerformerSelectorState extends State { itemBuilder: (context, index) { final person = snapshot.data[index]; - return ListTile( - title: Text('${person.lastName}, ${person.firstName}'), - onTap: () => Navigator.pop(context, PerformanceModel( - person: person, - role: role, - )), - ); + return RadioListTile( + controlAffinity: ListTileControlAffinity.trailing, + title: + Text('${person.lastName}, ${person.firstName}'), + value: person, + groupValue: this.person, + onChanged: (newPerson) { + setState(() { + this.person = newPerson; + }); + }); }, ); } else { @@ -93,7 +110,9 @@ class _PerformerSelectorState extends State { )); if (person != null) { - Navigator.pop(context, person); + setState(() { + this.person = person; + }); } }, ),