mirror of
https://github.com/wger-project/flutter.git
synced 2026-11-29 01:18:35 +01:00
Use ValueKey instead of accessing uuid directly
This would crash on objects that don't have any uuid attribute, such as the Language. ValueKey works on all of them, as long as they are equatable. Closes #1236
This commit is contained in:
@@ -78,7 +78,7 @@ class _ExerciseCategoryInputWidgetState<T> extends State<ExerciseCategoryInputWi
|
||||
},
|
||||
items: widget._entries.map<DropdownMenuItem<T>>((value) {
|
||||
return DropdownMenuItem<T>(
|
||||
key: Key(value.uuid.toString()),
|
||||
key: ValueKey(value),
|
||||
value: value,
|
||||
child: Text(widget._getDisplayName(value)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user