aves_mio1/lib/widgets/viewer/overlay/details/location.dart
FabioMich66 19a982ede6
Some checks are pending
Quality check / Flutter analysis (push) Waiting to run
Quality check / CodeQL analysis (java-kotlin) (push) Waiting to run
first commit
2026-03-05 15:51:30 +01:00

39 lines
1.3 KiB
Dart

import 'package:aves/model/entry/entry.dart';
import 'package:aves/model/entry/extensions/location.dart';
import 'package:aves/model/settings/enums/coordinate_format.dart';
import 'package:aves/model/settings/settings.dart';
import 'package:aves/theme/icons.dart';
import 'package:aves/theme/text.dart';
import 'package:aves/widgets/viewer/overlay/details/details.dart';
import 'package:decorated_icon/decorated_icon.dart';
import 'package:flutter/material.dart';
class OverlayLocationRow extends AnimatedWidget {
final AvesEntry entry;
OverlayLocationRow({
super.key,
required this.entry,
}) : super(listenable: entry.addressChangeNotifier);
@override
Widget build(BuildContext context) {
String? location;
if (entry.hasAddress) {
location = entry.shortAddress;
}
if (location == null || location.isEmpty) {
final latLng = entry.latLng;
if (latLng != null) {
location = settings.coordinateFormat.format(context, latLng);
}
}
return Row(
children: [
DecoratedIcon(AIcons.location, size: ViewerDetailOverlayContent.iconSize, shadows: ViewerDetailOverlayContent.shadows(context)),
const SizedBox(width: ViewerDetailOverlayContent.iconPadding),
Expanded(child: Text(location ?? AText.valueNotAvailable)),
],
);
}
}