invalid choice dialog

This commit is contained in:
Andrei Stoica 2024-12-27 22:22:40 -05:00
parent dbd492969a
commit 25483be0ae
1 changed files with 13 additions and 0 deletions

View File

@ -72,6 +72,19 @@ class _SuperGameState extends State<SuperGame> {
turn: turn, turn: turn,
cellOnTapCallback: (int i) { cellOnTapCallback: (int i) {
if (!_checkValidChoice(data[subGame], i)) { if (!_checkValidChoice(data[subGame], i)) {
showDialog(
context: context,
builder: (context) => AlertDialog(
content:
Text("${data[subGame][i].name.toUpperCase()}"
" already claimed "
"[${i % 3}, ${(i / 3).floor()}]"),
actions: [
ElevatedButton(
onPressed: () => Navigator.pop(context),
child: const Text("Close"))
],
));
return; return;
} }