From 24f86e7dba722e9a80b6af0f4cbeb71069e6637b Mon Sep 17 00:00:00 2001 From: aleeeee1 Date: Sat, 14 Oct 2023 10:52:35 +0200 Subject: [PATCH] fixed stupid thing --- lib/ui/pages/room/order.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ui/pages/room/order.dart b/lib/ui/pages/room/order.dart index eeb03cd..428fe61 100644 --- a/lib/ui/pages/room/order.dart +++ b/lib/ui/pages/room/order.dart @@ -74,11 +74,13 @@ class _OrderPageState extends State with AutomaticKeepAliveClientMixi ), ); + List userPlates = room.plates.where((element) => element.orderedBy.uid == widget.currentUser.uid).toList(); + return Row( children: [ field( TextFormField( - focusNode: _focusNodes[room.plates.indexOf(plate)], + focusNode: _focusNodes[userPlates.indexWhere((element) => element.id == plate.id)], textInputAction: TextInputAction.next, initialValue: plate.number, textAlign: TextAlign.center, @@ -124,7 +126,7 @@ class _OrderPageState extends State with AutomaticKeepAliveClientMixi ), IconButton( onPressed: () => { - _focusNodes.removeAt(room.plates.indexOf(plate)), + _focusNodes.removeAt(userPlates.indexOf(plate)), roomsAPI.removePlate(room, plate), }, icon: const Icon(Icons.delete),