From e0693b6f9b31cf158c7437102b29e27e52c08d36 Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Thu, 4 Apr 2024 17:22:50 +0200 Subject: [PATCH] update: minor fixes before merging to main --- app/lib/server_requests/init_state.dart | 2 +- app/lib/utils/custom_search_delegate.dart | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/lib/server_requests/init_state.dart b/app/lib/server_requests/init_state.dart index f57b75a1..d4ca66a1 100644 --- a/app/lib/server_requests/init_state.dart +++ b/app/lib/server_requests/init_state.dart @@ -48,7 +48,7 @@ Future<void> initSearchOptions() async { ..badCertificateCallback = // NB: temporary disable SSL certificate validation (X509Certificate cert, String host, int port) => true; - var request = await client.getUrl(Uri.parse('$serverURI/get_lake_names')); + var request = await client.getUrl(Uri.parse('${serverURI}get_lake_names')); var response = await request.close(); if (response.statusCode == 200) { diff --git a/app/lib/utils/custom_search_delegate.dart b/app/lib/utils/custom_search_delegate.dart index 13c62cf9..798c4c0b 100644 --- a/app/lib/utils/custom_search_delegate.dart +++ b/app/lib/utils/custom_search_delegate.dart @@ -69,9 +69,16 @@ class CustomSearchDelegate extends SearchDelegate { itemCount: searchResults.length, itemBuilder: (context, index) { var result = searchResults[index]; - return ListTile( - title: Text(result), - ); + if (searchResults.isNotEmpty) { + return ListTile( + title: Text(result), + ); + } + else { + return const ListTile( + title: Text("No matches found"), + ); + } }, ); } -- GitLab