Bejárás: pont színének megadása. Projekt export geopackage formátumban
This commit is contained in:
@@ -252,7 +252,9 @@ class _DrawerFooter extends StatelessWidget {
|
||||
FutureBuilder<PackageInfo>(
|
||||
future: PackageInfo.fromPlatform(),
|
||||
builder: (_, snap) => Text(
|
||||
snap.hasData ? 'v${snap.data!.version}' : '',
|
||||
snap.hasData
|
||||
? 'v${snap.data!.version}+${snap.data!.buildNumber}'
|
||||
: '',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: Colors.grey.shade500,
|
||||
|
||||
@@ -153,7 +153,7 @@ class ShellMapAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
controller: TrackingController.to,
|
||||
onTap: () => _openTrackingSheet(context),
|
||||
),
|
||||
PopupMenuButton(
|
||||
PopupMenuButton<int>(
|
||||
tooltip: 'További funkciók',
|
||||
icon: const Icon(Icons.more_vert),
|
||||
onSelected: (value) {
|
||||
@@ -163,16 +163,48 @@ class ShellMapAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
if (value == 0) {
|
||||
controller.openNoteItemList();
|
||||
}
|
||||
if (value == 2) {
|
||||
controller.toggleGeometryLabels();
|
||||
}
|
||||
if (value == 3) {
|
||||
controller.exportProject();
|
||||
}
|
||||
},
|
||||
itemBuilder: (context) => const [
|
||||
itemBuilder: (context) => [
|
||||
PopupMenuItem(
|
||||
value: 0,
|
||||
child: Text('Feljegyzések'),
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.line_axis),
|
||||
title: Text('Geometriák'),
|
||||
dense: true),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 2,
|
||||
child: ListTile(
|
||||
leading: Icon(
|
||||
controller.showGeometryLabels.value
|
||||
? Icons.label
|
||||
: Icons.label_off_outlined,
|
||||
color: controller.showGeometryLabels.value
|
||||
? Theme.of(context).colorScheme.primary
|
||||
: null),
|
||||
title: Text(controller.showGeometryLabels.value
|
||||
? "Feliartok elrejtése"
|
||||
: 'Feliratok megjelenítése'),
|
||||
),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: 1,
|
||||
child: Text('Rétegek'),
|
||||
),
|
||||
PopupMenuDivider(),
|
||||
PopupMenuItem(
|
||||
value: 3,
|
||||
child: ListTile(
|
||||
leading: const Icon(Icons.archive_outlined),
|
||||
title: const Text('Projekt exportálása'),
|
||||
dense: true,
|
||||
))
|
||||
])
|
||||
],
|
||||
bottom: PreferredSize(
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
// Szöveges feliratok a rögzített pontokhoz és vonalakhoz.
|
||||
// Poligonoknál a Polygon.label-t a view kezeli (flutter_map beépített).
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:terepi_seged/enums/map_survey_mode.dart';
|
||||
|
||||
import '../../enums/note_type.dart';
|
||||
import '../../pages/map_survey/presentations/controllers/map_survey_controller.dart';
|
||||
|
||||
class NoteItemLabelLayer extends StatelessWidget {
|
||||
final MapSurveyController controller;
|
||||
const NoteItemLabelLayer({super.key, required this.controller});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Obx(() {
|
||||
if (!controller.showGeometryLabels.value) return const SizedBox.shrink();
|
||||
if (controller.mode.value != MapSurveyMode.fieldWalk)
|
||||
return const SizedBox.shrink();
|
||||
|
||||
final markers = <Marker>[];
|
||||
|
||||
for (final item in controller.allNoteItems) {
|
||||
if (item.label.isEmpty) continue;
|
||||
|
||||
switch (item.type) {
|
||||
// ── Pont — felirat a marker felett ──────────────────────
|
||||
case NoteType.point:
|
||||
markers.add(Marker(
|
||||
point: item.points.first,
|
||||
width: 110,
|
||||
height: 48, // 22 szöveg + 22 pont marker helye
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_LabelBubble(label: item.label, color: item.color),
|
||||
//const SizedBox(height: 4), // pont marker fölé kerül
|
||||
],
|
||||
),
|
||||
));
|
||||
|
||||
// ── Vonal — felirat a felezőponton ──────────────────────
|
||||
case NoteType.line:
|
||||
if (item.points.isEmpty) continue;
|
||||
final mid = _midpoint(item.points);
|
||||
markers.add(Marker(
|
||||
point: mid,
|
||||
width: 120,
|
||||
height: 24,
|
||||
alignment: Alignment.center,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_LabelBubble(label: item.label, color: item.color),
|
||||
],
|
||||
),
|
||||
));
|
||||
|
||||
case NoteType.polygon:
|
||||
break; // poligonnál a Polygon.label kezeli a view-ban
|
||||
}
|
||||
}
|
||||
|
||||
if (markers.isEmpty) return const SizedBox.shrink();
|
||||
return MarkerLayer(markers: markers);
|
||||
});
|
||||
}
|
||||
|
||||
/// Vonal felezőpontja
|
||||
LatLng _midpoint(List<LatLng> points) {
|
||||
final mid = points[points.length ~/ 2];
|
||||
return mid;
|
||||
}
|
||||
}
|
||||
|
||||
// ─── Felirat buborék ─────────────────────────────────────────────────────────
|
||||
|
||||
class _LabelBubble extends StatelessWidget {
|
||||
final String label;
|
||||
final Color color;
|
||||
const _LabelBubble({required this.label, required this.color});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.92),
|
||||
borderRadius: BorderRadius.circular(5),
|
||||
border: Border(left: BorderSide(color: color, width: 3)),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.18),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.black87,
|
||||
height: 1.2,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_surv
|
||||
|
||||
class ColorRow extends StatelessWidget {
|
||||
final MapSurveyController ctrl;
|
||||
final double circleSize;
|
||||
|
||||
static const _palette = [
|
||||
Color(0xFF6C63FF),
|
||||
Color(0xFFE74C3C),
|
||||
@@ -13,7 +15,7 @@ class ColorRow extends StatelessWidget {
|
||||
Color(0xFF3498DB),
|
||||
Color(0xFF8BC34A),
|
||||
];
|
||||
const ColorRow({required this.ctrl});
|
||||
const ColorRow({required this.ctrl, this.circleSize = 40});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -31,8 +33,8 @@ class ColorRow extends StatelessWidget {
|
||||
onTap: () => ctrl.activeEditColor.value = color,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 150),
|
||||
width: 40,
|
||||
height: 40,
|
||||
width: circleSize,
|
||||
height: circleSize,
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
shape: BoxShape.circle,
|
||||
|
||||
Reference in New Issue
Block a user