From 25483be0ae8f29c8d4f59a5062d10a8a00156142 Mon Sep 17 00:00:00 2001 From: Andrei Stoica Date: Fri, 27 Dec 2024 22:22:40 -0500 Subject: [PATCH] invalid choice dialog --- lib/super.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/super.dart b/lib/super.dart index 965ecd8..1f91ef3 100644 --- a/lib/super.dart +++ b/lib/super.dart @@ -72,6 +72,19 @@ class _SuperGameState extends State { turn: turn, cellOnTapCallback: (int 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; }