From d0d7498c761fabc77df42715fd325dde1e8cc023 Mon Sep 17 00:00:00 2001 From: Hugo Bayer Date: Wed, 29 Jan 2020 11:40:27 +0100 Subject: [PATCH] Made servers closeable by clicking again --- lib/serverlist.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/serverlist.dart b/lib/serverlist.dart index a25b522..2529951 100644 --- a/lib/serverlist.dart +++ b/lib/serverlist.dart @@ -345,8 +345,12 @@ class _ServerListState extends State { } return GestureDetector( onTap: () { - setState(() => selectedServer = index); - print(index.toString() + " clicked"); + setState(() { + if (selectedServer == index) + selectedServer = -1; + else + selectedServer = index; + }); }, child: Container( width: MediaQuery.of(context).size.width, -- 2.47.0