fix choose_game_view not saving
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m3s
Pull Request Pipeline / lint (pull_request) Successful in 2m5s

This commit is contained in:
2026-01-03 10:16:28 +01:00
parent d081a597db
commit e4ae526d93

View File

@@ -47,39 +47,50 @@ class _ChooseGameViewState extends State<ChooseGameView> {
), ),
centerTitle: true, centerTitle: true,
), ),
body: Column( body: PopScope(
children: [ canPop: false,
Padding( onPopInvokedWithResult: (bool didPop, Object? result) {
padding: const EdgeInsets.symmetric(horizontal: 10), print(result);
child: CustomSearchBar( print(didPop);
controller: searchBarController, if (didPop) {
hintText: 'Game Name', return;
}
Navigator.of(context).pop(selectedGameIndex);
},
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: CustomSearchBar(
controller: searchBarController,
hintText: 'Game Name',
),
), ),
), const SizedBox(height: 5),
const SizedBox(height: 5), Expanded(
Expanded( child: ListView.builder(
child: ListView.builder( itemCount: widget.games.length,
itemCount: widget.games.length, itemBuilder: (BuildContext context, int index) {
itemBuilder: (BuildContext context, int index) { return TitleDescriptionListTile(
return TitleDescriptionListTile( title: widget.games[index].$1,
title: widget.games[index].$1, description: widget.games[index].$2,
description: widget.games[index].$2, badgeText: translateRulesetToString(widget.games[index].$3),
badgeText: translateRulesetToString(widget.games[index].$3), isHighlighted: selectedGameIndex == index,
isHighlighted: selectedGameIndex == index, onPressed: () async {
onPressed: () async { setState(() {
setState(() { if (selectedGameIndex == index) {
if (selectedGameIndex == index) { selectedGameIndex = -1;
selectedGameIndex = -1; } else {
} else { selectedGameIndex = index;
selectedGameIndex = index; }
} });
}); },
}, );
); },
}, ),
), ),
), ],
], ),
), ),
); );
} }