Skip to content

Commit

Permalink
fixed stupid thing
Browse files Browse the repository at this point in the history
  • Loading branch information
aleeeee1 committed Oct 14, 2023
1 parent a61c125 commit 24f86e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ui/pages/room/order.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ class _OrderPageState extends State<OrderPage> with AutomaticKeepAliveClientMixi
),
);

List<Plate> 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,
Expand Down Expand Up @@ -124,7 +126,7 @@ class _OrderPageState extends State<OrderPage> with AutomaticKeepAliveClientMixi
),
IconButton(
onPressed: () => {
_focusNodes.removeAt(room.plates.indexOf(plate)),
_focusNodes.removeAt(userPlates.indexOf(plate)),
roomsAPI.removePlate(room, plate),
},
icon: const Icon(Icons.delete),
Expand Down

0 comments on commit 24f86e7

Please sign in to comment.