fix: reorder attribute

This commit is contained in:
2026-05-23 00:34:28 +02:00
parent 7d0f9b5c33
commit 4dd4a2f35a

View File

@@ -348,16 +348,17 @@ class _MatchResultViewState extends State<MatchResultView> {
onReorderEnd: (int n) async { onReorderEnd: (int n) async {
await HapticFeedback.selectionClick(); await HapticFeedback.selectionClick();
}, },
onReorder: (int oldIndex, int newIndex) { onReorderItem:
setState(() { (int oldIndex, int newIndex) {
if (newIndex > oldIndex) { setState(() {
newIndex -= 1; if (newIndex > oldIndex) {
} newIndex -= 1;
final Player item = allPlayers }
.removeAt(oldIndex); final Player item = allPlayers
allPlayers.insert(newIndex, item); .removeAt(oldIndex);
}); allPlayers.insert(newIndex, item);
}, });
},
itemCount: allPlayers.length, itemCount: allPlayers.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return TextIconListTile( return TextIconListTile(