#549 changed place strategy

This commit is contained in:
Thibault Deckers 2023-03-22 10:47:53 +01:00
parent 9820d32b66
commit 708f1310e4
2 changed files with 6 additions and 1 deletions

View file

@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
### Added ### Added
- Info: improved state/place display (requires rescan, limited to AU/GB/EN)
- improved support for system font scale - improved support for system font scale
### Fixed ### Fixed

View file

@ -54,12 +54,16 @@ extension ExtraAvesEntryLocation on AvesEntry {
: call()); : call());
if (addresses.isNotEmpty) { if (addresses.isNotEmpty) {
final v = addresses.first; final v = addresses.first;
var locality = v.locality ?? v.subLocality ?? v.featureName;
if (locality == null || locality == v.subThoroughfare) {
locality = v.subAdminArea ?? v.addressLine;
}
addressDetails = AddressDetails( addressDetails = AddressDetails(
id: id, id: id,
countryCode: v.countryCode?.toUpperCase(), countryCode: v.countryCode?.toUpperCase(),
countryName: v.countryName, countryName: v.countryName,
adminArea: v.adminArea, adminArea: v.adminArea,
locality: v.locality ?? v.subLocality ?? v.featureName ?? v.subAdminArea ?? v.addressLine, locality: locality,
); );
} }
} catch (error, stack) { } catch (error, stack) {