getLocationSuggestions static method
Future<List<String> >
getLocationSuggestions(
- Position position, {
- bool includeCurrentPosition = true,
Implementation
static Future<List<String>> getLocationSuggestions(Position position, {bool includeCurrentPosition = true}) async {
neomLogger.d("Getting location suggestions for position: $position");
List<String> suggestions = await _getNearbySimpleAddresses(position);
if(includeCurrentPosition) {
Position? currentPosition = await _getCurrentPosition();
if(currentPosition != null) {
String currentAddress = await _getAddressSimple(currentPosition);
if(!suggestions.contains(currentAddress)) {
suggestions.add(currentAddress);
}
}
}
return suggestions;
}