Fix DropDownContacts
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Sarah Jamie Lewis 2021-05-24 17:38:07 -07:00
parent 502f8f7f11
commit dfe67b01ae
1 changed files with 4 additions and 6 deletions

View File

@ -18,7 +18,7 @@ class DropdownContacts extends StatefulWidget {
}
class _DropdownContactsState extends State<DropdownContacts> {
late String selected;
String? selected;
@override
Widget build(BuildContext context) {
@ -27,13 +27,11 @@ class _DropdownContactsState extends State<DropdownContacts> {
items: Provider.of<ProfileInfoState>(context, listen: false).contactList.contacts.map<DropdownMenuItem<String>>((ContactInfoState contact) {
return DropdownMenuItem<String>(value: contact.onion, child: Text(contact.nickname));
}).toList(),
onChanged: (newVal) {
onChanged: (String? newVal) {
setState(() {
this.selected = newVal.toString();
this.selected = newVal;
});
if (widget.onChanged != null) {
widget.onChanged(newVal);
}
widget.onChanged(newVal);
});
}
}