From e78630dbf069d2d6720099d83d12ce8705e22cb2 Mon Sep 17 00:00:00 2001 From: Alice Grey Date: Tue, 2 Mar 2021 17:29:57 -0600 Subject: [PATCH] Search again buttons should be hidden when search is in progress Fixes #105 --- lib/ui/setup/pair_page.dart | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/ui/setup/pair_page.dart b/lib/ui/setup/pair_page.dart index 52c2bc0c..8565bd11 100644 --- a/lib/ui/setup/pair_page.dart +++ b/lib/ui/setup/pair_page.dart @@ -170,18 +170,20 @@ class PairPage extends HookWidget implements CobbleScreen { ), ) .toList(), - FlatButton( - child: Text("SEARCH AGAIN WITH BLE"), - padding: EdgeInsets.symmetric(horizontal: 32.0), - textColor: Theme.of(context).accentColor, - onPressed: _refreshDevicesBle, - ), - FlatButton( - child: Text("SEARCH AGAIN WITH BT CLASSIC"), - padding: EdgeInsets.symmetric(horizontal: 32.0), - textColor: Theme.of(context).accentColor, - onPressed: _refreshDevicesClassic, - ), + if (!scan.scanning) ...[ + FlatButton( + child: Text("SEARCH AGAIN WITH BLE"), + padding: EdgeInsets.symmetric(horizontal: 32.0), + textColor: Theme.of(context).accentColor, + onPressed: _refreshDevicesBle, + ), + FlatButton( + child: Text("SEARCH AGAIN WITH BT CLASSIC"), + padding: EdgeInsets.symmetric(horizontal: 32.0), + textColor: Theme.of(context).accentColor, + onPressed: _refreshDevicesClassic, + ), + ], if (fromLanding) FlatButton( child: Text("SKIP"),