Skip to content

Commit

Permalink
Add custom text for first search #52
Browse files Browse the repository at this point in the history
  • Loading branch information
svendroid committed Jun 11, 2022
1 parent 56d8a2d commit df02ba5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ui/map/search_location/search_location_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ class _SearchLocationScreenState extends State<SearchLocationScreen> {
height: 16,
),
Text(
"Keine Ergebnisse vorhanden.\nBitte gebe einen Suchbegriff z.B. eine Straße in München ein..",
model.isFirstSearch
? "Bitte gebe einen Suchbegriff z.B. eine Straße in München ein."
: "Keine Ergebnisse vorhanden.\nBitte überprüfe den Suchbegriff.",
style: TextStyle(fontSize: 18.0),
textAlign: TextAlign.center,
)
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/map/search_location/search_location_screen_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ import 'package:munich_ways/ui/map/search_location/nominatim_api.dart';
class SearchLocationScreenViewModel extends ChangeNotifier {
bool loading = false;

bool isFirstSearch = true;

List<Place> places = [];

NominatimApi api = NominatimApi();

String errorMsg = null;

Future<void> startSearch(String query) async {
isFirstSearch = false;
log.d("startSearch " + query);
clearErrorMsg();

Expand Down

0 comments on commit df02ba5

Please sign in to comment.