added text if no search results were found

This commit is contained in:
bytedream 2024-03-27 18:27:13 +01:00
parent ef8c5e9039
commit 628d52f01f

View File

@ -38,8 +38,18 @@ class LocationSearchDelegate extends SearchDelegate<LatLng?> {
case ConnectionState.active:
case ConnectionState.none:
case ConnectionState.done:
if ((snapshot.data?.length ?? 0) == 0) {
return const Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(height: 50),
Text("Keine Sucherergebnisse gefunden")
],
);
}
return ListView.builder(
itemCount: snapshot.data?.length ?? 0,
itemCount: snapshot.data!.length,
itemBuilder: (context, index) {
Place place = snapshot.data![index];
return ListTile(