wgs84 és eov koordinátákat megjelenítő kártyák, eov magasság

This commit is contained in:
2026-06-07 11:45:15 +02:00
parent 497821bb41
commit b85cdb2596
9 changed files with 422 additions and 1 deletions
+43
View File
@@ -0,0 +1,43 @@
import 'package:flutter/material.dart';
class CoordinateRow extends StatelessWidget {
final String label;
final String value;
const CoordinateRow({
required this.label,
required this.value,
});
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 34,
child: Text(
label,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w600,
),
),
),
Expanded(
child: SelectableText(
value,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontFeatures: const [
FontFeature.tabularFigures(),
],
fontWeight: FontWeight.w600,
),
),
),
],
);
}
}
+54
View File
@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';
import 'package:terepi_seged/widgets/map_info_card.dart';
import 'coordinate_row.dart';
class EovCoordinateCard extends StatelessWidget {
final MapSurveyController controller;
const EovCoordinateCard({
super.key,
required this.controller,
});
@override
Widget build(BuildContext context) {
return Obx(() {
return MapInfoCard(
onClose: controller.toggleShowEovCard,
title: Row(
children: [
const Icon(Icons.grid_on, size: 18),
const SizedBox(width: 6),
Text(
'EOV',
style: Theme.of(context).textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w700,
),
),
],
),
child: Column(
children: [
CoordinateRow(
label: 'Y',
value: controller.eovY.value.toStringAsFixed(3),
),
const SizedBox(height: 4),
CoordinateRow(
label: 'X',
value: controller.eovX.value.toStringAsFixed(3),
),
const SizedBox(height: 4),
CoordinateRow(
label: 'Z',
value: controller.eovHeight.value?.toStringAsFixed(3) ?? '-',
),
],
),
);
});
}
}
+44
View File
@@ -0,0 +1,44 @@
import 'package:flutter/material.dart';
import 'package:terepi_seged/controls/wgs84_coordinate_formatter.dart';
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';
class FormatMenuButton extends StatelessWidget {
final MapSurveyController controller;
const FormatMenuButton({
required this.controller,
});
@override
Widget build(BuildContext context) {
return PopupMenuButton<Wgs84CoordinateFormat>(
tooltip: 'Koordinátaformátum',
initialValue: controller.wgs84CoordinateFormat.value,
onSelected: controller.setWgs84CoordinateFormat,
itemBuilder: (context) {
return Wgs84CoordinateFormat.values.map((format) {
return CheckedPopupMenuItem<Wgs84CoordinateFormat>(
value: format,
checked: controller.wgs84CoordinateFormat.value == format,
child: Text(format.label),
);
}).toList();
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(
controller.wgs84CoordinateFormat.value.shortLabel,
style: Theme.of(context).textTheme.labelMedium?.copyWith(
fontWeight: FontWeight.w700,
),
),
const Icon(Icons.arrow_drop_down, size: 18),
],
),
),
);
}
}
+55
View File
@@ -0,0 +1,55 @@
import 'package:flutter/material.dart';
class MapInfoCard extends StatelessWidget {
final Widget title;
final Widget child;
final VoidCallback? onClose;
const MapInfoCard({
super.key,
required this.title,
required this.child,
this.onClose,
});
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
final screenWidth = MediaQuery.sizeOf(context).width;
return Material(
elevation: 6,
color: colorScheme.surface.withOpacity(0.64),
borderRadius: BorderRadius.circular(18),
child: Container(
width: screenWidth - 60,
padding: const EdgeInsets.fromLTRB(6, 2, 6, 2),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
border: Border.all(
color: colorScheme.outlineVariant.withOpacity(0.7),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Expanded(child: title),
if (onClose != null)
IconButton(
visualDensity: VisualDensity.compact,
tooltip: 'Kártya bezárása',
icon: const Icon(Icons.close, size: 18),
onPressed: onClose,
),
],
),
const SizedBox(height: 6),
child,
],
),
),
);
}
}
+51
View File
@@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';
import 'package:terepi_seged/widgets/wgs84_coordinate_card.dart';
import 'eov_coordinate_card.dart';
class MapInfoCardColumn extends StatelessWidget {
final MapSurveyController controller;
const MapInfoCardColumn({
super.key,
required this.controller,
});
@override
Widget build(BuildContext context) {
final screenHeight = MediaQuery.sizeOf(context).height;
final screenWidth = MediaQuery.sizeOf(context).width;
return Obx(() {
final cards = <Widget>[];
if (controller.showWgs84Card.value) {
cards.add(Wgs84CoordinateCard(controller: controller));
}
if (controller.showEovCard.value) {
cards.add(EovCoordinateCard(controller: controller));
}
if (cards.isEmpty) {
return const SizedBox.shrink();
}
return ConstrainedBox(
constraints: BoxConstraints(
maxWidth: screenWidth - 50, maxHeight: screenHeight * 0.55),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
for (var i = 0; i < cards.length; i++) ...[
cards[i],
if (i != cards.length - 1) const SizedBox(height: 8)
]
],
),
));
});
}
}
+52
View File
@@ -0,0 +1,52 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';
import 'map_info_card.dart';
import 'format_menu_button.dart';
import 'coordinate_row.dart';
class Wgs84CoordinateCard extends StatelessWidget {
final MapSurveyController controller;
const Wgs84CoordinateCard({
super.key,
required this.controller,
});
@override
Widget build(BuildContext context) {
return Obx(() {
return MapInfoCard(
onClose: controller.toggleShowWgs84Card,
title: Row(
children: [
const Icon(Icons.public, size: 18),
const SizedBox(width: 6),
Text(
'WGS84',
style: Theme.of(context).textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w700,
),
),
const Spacer(),
FormatMenuButton(controller: controller),
],
),
child: Column(
children: [
CoordinateRow(
label: 'Lat',
value: controller.latitudeText,
),
const SizedBox(height: 4),
CoordinateRow(
label: 'Lon',
value: controller.longitudeText,
),
],
),
);
});
}
}