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:
Roland Geider
2026-06-23 15:32:42 +02:00
parent 3eb7974390
commit 65dbf426cf

View File

@@ -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)),
);