info: show coordinates along address

This commit is contained in:
Thibault Deckers 2020-08-21 11:11:14 +09:00
parent f8928f557f
commit cf4be6a7a3
2 changed files with 4 additions and 13 deletions

View file

@ -178,7 +178,7 @@ class SectionRow extends StatelessWidget {
children: [ children: [
buildDivider(), buildDivider(),
Padding( Padding(
padding: EdgeInsets.all(16.0), padding: EdgeInsets.all(16),
child: Icon( child: Icon(
icon, icon,
size: dim, size: dim,

View file

@ -83,18 +83,12 @@ class _LocationSectionState extends State<LocationSection> {
if (country != null && country.isNotEmpty) filters.add(LocationFilter(LocationLevel.country, '$country;${address.countryCode}')); if (country != null && country.isNotEmpty) filters.add(LocationFilter(LocationLevel.country, '$country;${address.countryCode}'));
final place = address.place; final place = address.place;
if (place != null && place.isNotEmpty) filters.add(LocationFilter(LocationLevel.place, place)); if (place != null && place.isNotEmpty) filters.add(LocationFilter(LocationLevel.place, place));
} else if (entry.hasGps) {
location = toDMS(entry.latLng).join(', ');
} }
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (widget.showTitle) if (widget.showTitle) SectionRow(AIcons.location),
Padding(
padding: EdgeInsets.only(bottom: 8),
child: SectionRow(AIcons.location),
),
NotificationListener( NotificationListener(
onNotification: (notification) { onNotification: (notification) {
if (notification is MapStyleChangedNotification) setState(() {}); if (notification is MapStyleChangedNotification) setState(() {});
@ -114,11 +108,8 @@ class _LocationSectionState extends State<LocationSection> {
style: settings.infoMapStyle, style: settings.infoMapStyle,
), ),
), ),
if (location.isNotEmpty) if (entry.hasGps) InfoRowGroup({'Coordinates': toDMS(entry.latLng).join(', ')}),
Padding( if (location.isNotEmpty) InfoRowGroup({'Address': location}),
padding: EdgeInsets.only(top: 8),
child: InfoRowGroup({'Address': location}),
),
if (filters.isNotEmpty) if (filters.isNotEmpty)
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: AvesFilterChip.outlineWidth / 2) + EdgeInsets.only(top: 8), padding: EdgeInsets.symmetric(horizontal: AvesFilterChip.outlineWidth / 2) + EdgeInsets.only(top: 8),